Merge branch 'rose' of https://gitea.lihaink.cn/mkm/multi-store into rose
This commit is contained in:
commit
518d9fe064
@ -64,7 +64,11 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface
|
|||||||
->order(['id' => 'desc'])
|
->order(['id' => 'desc'])
|
||||||
->select()->each(function ($item) {
|
->select()->each(function ($item) {
|
||||||
$item['pay_time'] = $item['pay_time'] > 0 ? date('Y-m-d H:i:s', $item['pay_time']) : '';
|
$item['pay_time'] = $item['pay_time'] > 0 ? date('Y-m-d H:i:s', $item['pay_time']) : '';
|
||||||
|
if($item['status']==-1){
|
||||||
|
$item['status_name'] = OrderEnum::refundStatus($item['refund_status']) ?? '';
|
||||||
|
}else{
|
||||||
$item['status_name'] = OrderEnum::getOrderType($item['status']) ?? '';
|
$item['status_name'] = OrderEnum::getOrderType($item['status']) ?? '';
|
||||||
|
}
|
||||||
if ($item['uid'] <= 0) {
|
if ($item['uid'] <= 0) {
|
||||||
$item['nickname'] = '游客';
|
$item['nickname'] = '游客';
|
||||||
} else {
|
} else {
|
||||||
|
@ -47,7 +47,7 @@ class StoreOrderCartInfoLists extends BaseAdminDataLists implements ListsSearchI
|
|||||||
return StoreOrderCartInfo::where($this->searchWhere)
|
return StoreOrderCartInfo::where($this->searchWhere)
|
||||||
->field('cart_info,product_id,store_id')->limit($this->limitOffset, $this->limitLength)
|
->field('cart_info,product_id,store_id')->limit($this->limitOffset, $this->limitLength)
|
||||||
->select()->each(function ($item) {
|
->select()->each(function ($item) {
|
||||||
$find=StoreBranchProduct::where('product_id',$item['product_id'])->where('store_id',$item['store_id'])->field('image,store_name,store_info')->find();
|
$find=StoreProduct::where('id',$item['product_id'])->field('image,store_name,store_info')->find();
|
||||||
if($find){
|
if($find){
|
||||||
$item['image']=$find['image'];//商品图片
|
$item['image']=$find['image'];//商品图片
|
||||||
$item['store_name']=$find['store_name'];//商品名称
|
$item['store_name']=$find['store_name'];//商品名称
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
namespace app\common\logic;
|
namespace app\common\logic;
|
||||||
|
|
||||||
use app\common\enum\OrderEnum;
|
use app\common\enum\OrderEnum;
|
||||||
|
use app\common\enum\PayEnum;
|
||||||
use app\common\model\finance\CapitalFlow;
|
use app\common\model\finance\CapitalFlow;
|
||||||
|
|
||||||
class CapitalFlowLogic extends BaseLogic
|
class CapitalFlowLogic extends BaseLogic
|
||||||
@ -72,12 +73,15 @@ class CapitalFlowLogic extends BaseLogic
|
|||||||
$model->link_type = $linkType;
|
$model->link_type = $linkType;
|
||||||
$model->link_id = $linkId;
|
$model->link_id = $linkId;
|
||||||
$model->amount = $amount;
|
$model->amount = $amount;
|
||||||
if ($payType == OrderEnum::BALANCE_PAYMEN_NO) {
|
if ($payType == PayEnum::PURCHASE_FUNDS) {
|
||||||
$model->before_balance = $this->user['purchase_funds'];
|
$model->before_balance = bcadd($this->user['purchase_funds'],$amount,2);
|
||||||
$model->balance = bcsub($this->user['purchase_funds'], $amount, 2);
|
$model->balance = $this->user['purchase_funds'];
|
||||||
|
} elseif ($payType == PayEnum::BALANCE_PAY){
|
||||||
|
$model->before_balance = bcadd($this->user['now_money'],$amount,2);
|
||||||
|
$model->balance = $this->user['now_money'];
|
||||||
}else{
|
}else{
|
||||||
$model->before_balance = $this->user['now_money'];
|
$model->before_balance = $this->user['now_money'];
|
||||||
$model->balance = bcsub($this->user['now_money'], $amount, 2);
|
$model->balance = $this->user['now_money'];
|
||||||
}
|
}
|
||||||
$model->create_time = date('Y-m-d H:i:s');
|
$model->create_time = date('Y-m-d H:i:s');
|
||||||
$model->type = 'out';
|
$model->type = 'out';
|
||||||
|
@ -93,7 +93,7 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
}
|
}
|
||||||
// self::addUserSing($order);
|
// self::addUserSing($order);
|
||||||
$capitalFlowDao = new CapitalFlowLogic($user);
|
$capitalFlowDao = new CapitalFlowLogic($user);
|
||||||
$capitalFlowDao->userExpense('user_order_balance_pay', 'order', $order['id'], $order['pay_price'], '', 0, $order['store_id']);
|
$capitalFlowDao->userExpense('user_order_balance_pay', 'order', $order['id'], $order['pay_price'], '', 3, $order['store_id']);
|
||||||
self::dealProductLog($order);
|
self::dealProductLog($order);
|
||||||
|
|
||||||
self::afterPay($order);
|
self::afterPay($order);
|
||||||
@ -203,7 +203,7 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
$user->save();
|
$user->save();
|
||||||
|
|
||||||
$capitalFlowDao = new CapitalFlowLogic($user);
|
$capitalFlowDao = new CapitalFlowLogic($user);
|
||||||
$capitalFlowDao->userExpense('user_order_purchase_pay', 'order', $order['id'], $order['pay_price'], '', 1, $order['store_id']);
|
$capitalFlowDao->userExpense('user_order_purchase_pay', 'order', $order['id'], $order['pay_price'], '', 18, $order['store_id']);
|
||||||
// if ($user['user_ship'] == 1) {
|
// if ($user['user_ship'] == 1) {
|
||||||
// self::dealVipAmount($order, PayEnum::PURCHASE_FUNDS);
|
// self::dealVipAmount($order, PayEnum::PURCHASE_FUNDS);
|
||||||
// }
|
// }
|
||||||
@ -263,7 +263,7 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
} else {
|
} else {
|
||||||
$capitalFlowDao = new CapitalFlowLogic($user);
|
$capitalFlowDao = new CapitalFlowLogic($user);
|
||||||
//微信支付和用户余额无关
|
//微信支付和用户余额无关
|
||||||
$capitalFlowDao->userExpense('user_order_pay', 'order', $order['id'], $order->pay_price, '', 1, $order['store_id']);
|
$capitalFlowDao->userExpense('user_order_pay', 'order', $order['id'], $order->pay_price, '', 0, $order['store_id']);
|
||||||
}
|
}
|
||||||
$order->save();
|
$order->save();
|
||||||
if ($order['reservation'] == 1 && in_array($order['shipping_type'], [1, 2])) {
|
if ($order['reservation'] == 1 && in_array($order['shipping_type'], [1, 2])) {
|
||||||
@ -304,10 +304,10 @@ class PayNotifyLogic extends BaseLogic
|
|||||||
$capitalFlowDao = new CapitalFlowLogic($user);
|
$capitalFlowDao = new CapitalFlowLogic($user);
|
||||||
if ($purchase_funds >= $orderRe['price']) {
|
if ($purchase_funds >= $orderRe['price']) {
|
||||||
User::where('id', $orderRe['uid'])->dec('purchase_funds', $orderRe['refund_price'])->update();
|
User::where('id', $orderRe['uid'])->dec('purchase_funds', $orderRe['refund_price'])->update();
|
||||||
$capitalFlowDao->userExpense('user_balance_recharge_refund', 'order', $orderRe['id'], $orderRe['refund_price'], '', 1, $orderRe['store_id']);
|
$capitalFlowDao->userExpense('user_balance_recharge_refund', 'order', $orderRe['id'], $orderRe['refund_price'], '', 0, $orderRe['store_id']);
|
||||||
} else {
|
} else {
|
||||||
User::where('id', $orderRe['uid'])->dec('purchase_funds', $purchase_funds)->update();
|
User::where('id', $orderRe['uid'])->dec('purchase_funds', $purchase_funds)->update();
|
||||||
$capitalFlowDao->userExpense('user_balance_recharge_refund', 'order', $orderRe['id'], $purchase_funds, '', 1, $orderRe['store_id']);
|
$capitalFlowDao->userExpense('user_balance_recharge_refund', 'order', $orderRe['id'], $purchase_funds, '', 0, $orderRe['store_id']);
|
||||||
}
|
}
|
||||||
//退还 充值得兑换券
|
//退还 充值得兑换券
|
||||||
UserSignLogic::RefundRecharge($orderRe);
|
UserSignLogic::RefundRecharge($orderRe);
|
||||||
|
@ -40,7 +40,11 @@ class StoreOrder extends BaseModel
|
|||||||
|
|
||||||
public function getStatusNameTextAttr($value, $data)
|
public function getStatusNameTextAttr($value, $data)
|
||||||
{
|
{
|
||||||
|
if($data['status']==-1){
|
||||||
|
$status = OrderEnum::refundStatus($data['refund_status']) ?? '';
|
||||||
|
}else{
|
||||||
$status = OrderEnum::getOrderType($data['status']) ?? '';
|
$status = OrderEnum::getOrderType($data['status']) ?? '';
|
||||||
|
}
|
||||||
return $status;
|
return $status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user