Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
my-yaf-project
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenchuanwen
my-yaf-project
Commits
31ba6060
Commit
31ba6060
authored
Nov 01, 2018
by
wwccw0591
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master_dev' of git.shenbd.com:qm-develop/shenbd into ccw
parents
fdaef8ed
efcbee66
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
32 additions
and
17 deletions
+32
-17
GoodsCommonService.php
application/models/Business/Goods/GoodsCommonService.php
+12
-6
RefundService.php
application/models/Business/Order/RefundService.php
+8
-4
FeedBackService.php
application/models/Business/User/FeedBackService.php
+2
-1
GoodsCommon.php
application/models/DAO/GoodsCommon.php
+6
-2
RefundReturn.php
application/models/DAO/Order/RefundReturn.php
+1
-1
GoodsClassRedis.php
application/models/Redis/Db6/GoodsClassRedis.php
+0
-0
Feedback.php
application/modules/Client/controllers/Feedback.php
+2
-2
Shopkeeper.php
application/modules/Client/controllers/Shopkeeper.php
+1
-1
No files found.
application/models/Business/Goods/GoodsCommonService.php
View file @
31ba6060
...
@@ -14,7 +14,16 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
...
@@ -14,7 +14,16 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
}
}
public
function
setGoodsStorage
(
$storeId
,
$goodsId
,
$num
=
0
,
$type
=
'set'
)
{
/**
* 设置库存
* @param $storeId
* @param $goodsId
* @param int $num
* @param string $type
* @return array
* @throws \Exception
*/
public
function
setGoodsStorage
(
$storeId
,
$goodsId
,
$num
=
0
,
$type
=
'add'
)
{
if
(
$goodsId
===
0
){
if
(
$goodsId
===
0
){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
commonError
);
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
commonError
);
}
}
...
@@ -27,13 +36,10 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
...
@@ -27,13 +36,10 @@ class GoodsCommonServiceModel extends \Business\AbstractModel
if
(
!
$data
)
{
if
(
!
$data
)
{
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
goodsNotExist
);
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
goodsNotExist
);
}
}
$op
=
isset
(
$this
->
setStorageType
[
$type
])
?
$this
->
setStorageType
[
$type
]
:
2
;
//默认设置
库存
$op
=
isset
(
$this
->
setStorageType
[
$type
])
?
$this
->
setStorageType
[
$type
]
:
1
;
//默认增加
库存
$goodsDao
->
db
->
doTransaction
();
$goodsDao
->
db
->
doTransaction
();
$ret1
=
$goodsDao
->
updateStorage
(
$goodsId
,
$num
,
$op
);
$ret1
=
$goodsDao
->
updateStorage
(
$goodsId
,
$num
,
$op
);
$ret2
=
true
;
$ret2
=
$commonDao
->
updateStorage
(
$data
[
'goods_commonid'
],
$op
);
if
(
$op
==
1
)
{
//如果就库存调整
$ret2
=
$commonDao
->
updateStorage
(
$data
[
'goods_commonid'
]);
}
if
(
!
$ret1
||
!
$ret2
)
{
if
(
!
$ret1
||
!
$ret2
)
{
$goodsDao
->
db
->
doRollback
();
$goodsDao
->
db
->
doRollback
();
...
...
application/models/Business/Order/RefundService.php
View file @
31ba6060
...
@@ -238,6 +238,7 @@ class RefundServiceModel extends \Business\AbstractModel
...
@@ -238,6 +238,7 @@ class RefundServiceModel extends \Business\AbstractModel
//$this->recordSellerLog('退款处理,退款编号:'.$refund['refund_sn']); //待确认
//$this->recordSellerLog('退款处理,退款编号:'.$refund['refund_sn']); //待确认
$refundReturnDao
->
deleteRefundCache
(
$refund
[
'buyer_id'
],
$refund
[
'refund_id'
]);
$refundReturnDao
->
deleteRefundCache
(
$refund
[
'buyer_id'
],
$refund
[
'refund_id'
]);
$orderDao
->
deleteOrderCache
(
$refund
[
'buyer_id'
],
$refund
[
'order_id'
],
$refund
[
'store_id'
]);
$orderDao
->
deleteOrderCache
(
$refund
[
'buyer_id'
],
$refund
[
'order_id'
],
$refund
[
'store_id'
]);
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db5\OrderRedisModel
::
getInstance
(),
array
(
&
$refundReturnDao
,
'getList'
),
array
(),
array
(
$refund
[
'store_id'
]));
$refundReturnDao
->
db
->
doCommit
();
$refundReturnDao
->
db
->
doCommit
();
return
true
;
return
true
;
}
}
...
@@ -264,15 +265,15 @@ class RefundServiceModel extends \Business\AbstractModel
...
@@ -264,15 +265,15 @@ class RefundServiceModel extends \Business\AbstractModel
//检测该店铺是否开启直接退款功能
//检测该店铺是否开启直接退款功能
$storeDAO
=
\DAO\StoreModel
::
getInstance
();
$storeDAO
=
\DAO\StoreModel
::
getInstance
();
//店铺积分
//店铺积分
$is_direct_refund
=
$storeDAO
->
getInfoById
(
$storeId
,
'is_direct_refund'
,
true
);
$is_direct_refund
=
$storeDAO
->
getInfoById
(
$storeId
,
'is_direct_refund'
,
'is_direct_refund'
);
$orderGoodsDao
->
update
(
array
(
'rec_id'
=>
$refund
[
'order_goods_id'
]),
array
(
'refund_state_name'
=>
'卖家同意退款'
));
$orderGoodsDao
->
update
(
array
(
'rec_id'
=>
$refund
[
'order_goods_id'
]),
array
(
'refund_state_name'
=>
'卖家同意退款'
));
if
(
$is_direct_refund
==
1
){
//支持直接退款
if
(
$is_direct_refund
==
1
){
//支持直接退款
//退款 检测该订单是否为线上支付
//退款 检测该订单是否为线上支付
$updateData
=
array
(
'is_suc_refund'
=>
1
,
'gmt_update'
=>
TIMESTAMP
);
$updateData
=
array
(
'is_suc_refund'
=>
1
,
'gmt_update'
=>
TIMESTAMP
);
if
(
$refund
[
'refund_amount'
]
>
0
){
if
(
$refund
_array
[
'refund_amount'
]
>
0
){
$payment_type
=
$order_info
[
'payment_type'
];
$payment_type
=
$order_info
[
'payment_type'
];
if
(
!
in_array
(
$payment_type
,
array
(
0
,
2
))){
if
(
!
in_array
(
$payment_type
,
array
(
0
,
2
))){
$state
=
$refundReturnDao
->
storeRefund
(
array_merge
(
$order_info
,
array
(
'refund_order_no'
=>
$refund
[
'order_sn'
],
'refund_amount'
=>
$refund
[
'refund_amount'
])));
$state
=
$refundReturnDao
->
storeRefund
(
array_merge
(
$order_info
,
array
(
'refund_order_no'
=>
$refund
[
'order_sn'
],
'refund_amount'
=>
$refund
_array
[
'refund_amount'
])));
if
(
!
$state
)
{
if
(
!
$state
)
{
//throw new Exception('更新订单信息失败');
//throw new Exception('更新订单信息失败');
$refundReturnDao
->
db
->
doRollback
();
$refundReturnDao
->
db
->
doRollback
();
...
@@ -300,6 +301,7 @@ class RefundServiceModel extends \Business\AbstractModel
...
@@ -300,6 +301,7 @@ class RefundServiceModel extends \Business\AbstractModel
}
}
$refundReturnDao
->
deleteRefundCache
(
$refund
[
'buyer_id'
],
$refund
[
'refund_id'
]);
$refundReturnDao
->
deleteRefundCache
(
$refund
[
'buyer_id'
],
$refund
[
'refund_id'
]);
$orderDao
->
deleteOrderCache
(
$refund
[
'buyer_id'
],
$refund
[
'order_id'
],
$refund
[
'store_id'
]);
$orderDao
->
deleteOrderCache
(
$refund
[
'buyer_id'
],
$refund
[
'order_id'
],
$refund
[
'store_id'
]);
\Our\RedisHelper
::
delCachedFunction
(
\Redis\Db5\OrderRedisModel
::
getInstance
(),
array
(
&
$refundReturnDao
,
'getList'
),
array
(),
array
(
$refund
[
'store_id'
]));
$refundReturnDao
->
db
->
doCommit
();
$refundReturnDao
->
db
->
doCommit
();
return
true
;
return
true
;
}
}
...
@@ -315,6 +317,7 @@ class RefundServiceModel extends \Business\AbstractModel
...
@@ -315,6 +317,7 @@ class RefundServiceModel extends \Business\AbstractModel
* @return bool
* @return bool
*/
*/
private
function
edit_points
(
$refund
,
$order_info
){
private
function
edit_points
(
$refund
,
$order_info
){
return
true
;
//暂时不对积分做处理
$settingDAO
=
\DAO\SettingModel
::
getInstance
();
$settingDAO
=
\DAO\SettingModel
::
getInstance
();
$points_ratio
=
floatval
(
$settingDAO
->
getListCache
(
array
(
'points_ratio'
))[
'points_ratio'
]);
$points_ratio
=
floatval
(
$settingDAO
->
getListCache
(
array
(
'points_ratio'
))[
'points_ratio'
]);
...
@@ -389,6 +392,7 @@ class RefundServiceModel extends \Business\AbstractModel
...
@@ -389,6 +392,7 @@ class RefundServiceModel extends \Business\AbstractModel
$orderGoodsDao
=
\DAO\Order\OrderGoodsModel
::
getInstance
(
DbNameConst
::
salveDBConnectName
);
$orderGoodsDao
=
\DAO\Order\OrderGoodsModel
::
getInstance
(
DbNameConst
::
salveDBConnectName
);
$goodsDao
=
\DAO\GoodsModel
::
getInstance
(
DbNameConst
::
salveDBConnectName
);
$goodsDao
=
\DAO\GoodsModel
::
getInstance
(
DbNameConst
::
salveDBConnectName
);
$where
[
'store_id'
]
=
$storeId
;
$where
[
'store_id'
]
=
$storeId
;
$where
[
'order_lock'
]
=
2
;
$order
=
array
(
'add_time'
=>
'desc'
);
$order
=
array
(
'add_time'
=>
'desc'
);
switch
(
$type
)
{
switch
(
$type
)
{
case
1
:
case
1
:
...
@@ -407,7 +411,7 @@ class RefundServiceModel extends \Business\AbstractModel
...
@@ -407,7 +411,7 @@ class RefundServiceModel extends \Business\AbstractModel
$orderGoodsId
=
array_column
(
$refundReturns
[
'list'
],
'orderGoodsId'
);
$orderGoodsId
=
array_column
(
$refundReturns
[
'list'
],
'orderGoodsId'
);
//获得售后商品列表getOrderGoodsByRecIds
//获得售后商品列表getOrderGoodsByRecIds
if
(
!
empty
(
$orderGoodsId
))
{
if
(
!
empty
(
$orderGoodsId
))
{
$orderGoods
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db5\OrderRedisModel
::
getInstance
(),
array
(
&
$orderGoodsDao
,
'getOrderGoodsByRecIds'
),
array
(
$orderGoodsId
,
$this
->
refundOrderGoodsField
),
\Our\ApiConst
::
oneDaySecond
,
array
(
$
member
Id
));
$orderGoods
=
\Our\RedisHelper
::
cachedFunction
(
\Redis\Db5\OrderRedisModel
::
getInstance
(),
array
(
&
$orderGoodsDao
,
'getOrderGoodsByRecIds'
),
array
(
$orderGoodsId
,
$this
->
refundOrderGoodsField
),
\Our\ApiConst
::
oneDaySecond
,
array
(
$
store
Id
));
$refundMerge
=
Common
::
intergrateOneToOne
(
$refundReturns
[
'list'
],
$orderGoods
,
'orderGoodsId'
,
'recId'
);
$refundMerge
=
Common
::
intergrateOneToOne
(
$refundReturns
[
'list'
],
$orderGoods
,
'orderGoodsId'
,
'recId'
);
foreach
(
$refundMerge
as
&
$value
)
{
foreach
(
$refundMerge
as
&
$value
)
{
$value
[
'stateName'
]
=
$refundReturnDao
->
getRefundTextStatus
(
$value
);
$value
[
'stateName'
]
=
$refundReturnDao
->
getRefundTextStatus
(
$value
);
...
...
application/models/Business/User/FeedBackService.php
View file @
31ba6060
...
@@ -22,10 +22,11 @@ class FeedBackServiceModel extends \Business\AbstractModel
...
@@ -22,10 +22,11 @@ class FeedBackServiceModel extends \Business\AbstractModel
public
function
saveFeedback
(
$param
,
$storeId
,
$memberId
)
{
public
function
saveFeedback
(
$param
,
$storeId
,
$memberId
)
{
$storeDAO
=
\DAO\StoreModel
::
getInstance
();
$storeDAO
=
\DAO\StoreModel
::
getInstance
();
$feedbackDescribe
=
trim
(
$param
[
'feedbackDescribe'
]);
$feedbackDescribe
=
trim
(
$param
[
'feedbackDescribe'
]);
$feedbackTelephone
=
$storeDAO
->
getInfoById
(
$storeId
,
'store_phone'
,
true
);
if
(
!
$feedbackDescribe
){
if
(
!
$feedbackDescribe
){
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
emptyFeedbackDescribe
);
\Error\ErrorModel
::
throwException
(
\Error\CodeConfigModel
::
emptyFeedbackDescribe
);
}
}
$feedbackTelephone
=
$storeDAO
->
getInfoById
(
$storeId
,
'store_phone'
,
'store_phone'
);
$insert
=
array
();
$insert
=
array
();
$insert
[
'feedback_type'
]
=
1
;
//店铺意见反馈
$insert
[
'feedback_type'
]
=
1
;
//店铺意见反馈
$insert
[
'feedback_describe'
]
=
$feedbackDescribe
;
$insert
[
'feedback_describe'
]
=
$feedbackDescribe
;
...
...
application/models/DAO/GoodsCommon.php
View file @
31ba6060
...
@@ -35,10 +35,14 @@ class GoodsCommonModel extends \DAO\AbstractModel {
...
@@ -35,10 +35,14 @@ class GoodsCommonModel extends \DAO\AbstractModel {
* @param $op 1增加 2设置
* @param $op 1增加 2设置
* @return mixed
* @return mixed
*/
*/
public
function
updateStorage
(
$goodsCommonid
)
{
public
function
updateStorage
(
$goodsCommonid
,
$op
=
1
)
{
$this
->
setDb
();
$this
->
setDb
();
$whereSql
=
'goods_commonid='
.
$goodsCommonid
;
$whereSql
=
'goods_commonid='
.
$goodsCommonid
;
$updateSql
=
'goods_storage = (select sum(t.goods_storage) from '
.
$this
->
_child_tableName
.
' t where t.goods_commonid='
.
$goodsCommonid
.
')'
;
if
(
$op
==
1
){
$updateSql
=
'goods_storage = (select sum(t.goods_storage) from '
.
$this
->
_child_tableName
.
' t where t.goods_commonid='
.
$goodsCommonid
.
')'
;
}
else
{
$updateSql
=
'goods_storage_alarm = 0'
;
}
$updateAllSql
=
"UPDATE
{
$this
->
_tableName
}
set
{
$updateSql
}
where
{
$whereSql
}
"
;
$updateAllSql
=
"UPDATE
{
$this
->
_tableName
}
set
{
$updateSql
}
where
{
$whereSql
}
"
;
return
$this
->
db
->
update
(
$this
->
_tableName
)
->
query
(
$updateAllSql
);
return
$this
->
db
->
update
(
$this
->
_tableName
)
->
query
(
$updateAllSql
);
}
}
...
...
application/models/DAO/Order/RefundReturn.php
View file @
31ba6060
...
@@ -413,7 +413,7 @@ class RefundReturnModel extends \DAO\AbstractModel {
...
@@ -413,7 +413,7 @@ class RefundReturnModel extends \DAO\AbstractModel {
}
}
$this
->
setDb
(
$this
->
dbName
);
$this
->
setDb
(
$this
->
dbName
);
if
(
is_array
(
$data
))
{
if
(
is_array
(
$data
))
{
$result
=
$this
->
db
->
update
(
$this
->
_tableName
)
->
rows
(
$data
)
->
where
(
$
where
)
->
execute
();
$result
=
$this
->
db
->
update
(
$this
->
_tableName
)
->
rows
(
$data
)
->
where
(
$
condition
)
->
execute
();
return
$result
;
return
$result
;
}
else
{
}
else
{
return
false
;
return
false
;
...
...
application/models/Redis/Db6/GoodsClassRedis.php
100755 → 100644
View file @
31ba6060
File mode changed from 100755 to 100644
application/modules/Client/controllers/Feedback.php
View file @
31ba6060
<?php
<?php
class
FeedbackController
extends
\Our\Controller_Abstract
Api
{
class
FeedbackController
extends
\Our\Controller_Abstract
Client
{
public
function
init
(){
public
function
init
(){
parent
::
init
();
parent
::
init
();
}
}
public
function
saveFeedbackAction
(){
public
function
saveFeedbackAction
(){
$msg
=
\Business\User\FeedBackServiceModel
::
getInstance
()
->
saveFeedback
(
$this
->
req
[
\Our\NameConst
::
data
],
$this
->
storeId
,
$this
->
memberId
);
$msg
=
\Business\User\FeedBackServiceModel
::
getInstance
()
->
saveFeedback
(
$this
->
req
[
\Our\NameConst
::
data
],
$this
->
storeId
,
$this
->
memberId
);
$this
->
success
(
''
);
$this
->
success
(
''
);
}
}
}
}
\ No newline at end of file
application/modules/Client/controllers/Shopkeeper.php
View file @
31ba6060
...
@@ -241,7 +241,7 @@ class ShopkeeperController extends \Our\Controller_AbstractClient {
...
@@ -241,7 +241,7 @@ class ShopkeeperController extends \Our\Controller_AbstractClient {
$type
=
intval
(
$this
->
req
[
'data'
][
'type'
]);
$type
=
intval
(
$this
->
req
[
'data'
][
'type'
]);
$refundService
=
\Business\Order\RefundServiceModel
::
getInstance
();
$refundService
=
\Business\Order\RefundServiceModel
::
getInstance
();
$pageIndex
=
$this
->
getPageIndex
();
$pageIndex
=
$this
->
getPageIndex
();
$pageSize
=
$this
->
getPageSize
();
$pageSize
=
$this
->
getPageSize
(
8
);
$res
=
$refundService
->
getStoreRefundList
(
$this
->
storeId
,
$type
,
$pageIndex
,
$pageSize
);
$res
=
$refundService
->
getStoreRefundList
(
$this
->
storeId
,
$type
,
$pageIndex
,
$pageSize
);
$this
->
success
(
$res
);
$this
->
success
(
$res
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment