This commit is contained in:
lewis 2025-01-13 11:14:32 +08:00
commit 227bde742d
3 changed files with 14 additions and 3 deletions

View File

@ -211,8 +211,13 @@ class WarehouseProductLogic extends BaseLogic
$nums=bcsub($params['nums'], $res['nums'],2);
self::incProductDecStorege($res, $nums,$admin_id);
}else{
$nums=bcsub($res['nums'],$params['nums'],2);
self::decProductIncStorege($res, $nums,$admin_id);
if($params['nums']==0){
$nums=$params['nums'];
self::decProductIncStorege($res, $nums,$admin_id);
}else{
$nums=bcsub($res['nums'],$params['nums'],2);
self::decProductIncStorege($res, $nums,$admin_id);
}
}
$datas = [
'total_price' => $params['total_price'],

View File

@ -8,19 +8,23 @@ use app\common\model\store_cash_finance_flow\StoreCashFinanceFlow;
class CashFlowLogic extends BaseLogic
{
public function insert($storeId, $amount)
public function insert($storeId, $amount,$source_mark='')
{
$model = new StoreCashFinanceFlow();
$find = $model->where(['store_id' => $storeId])->whereDay('create_time')->where('status', 0)->find();
if ($find) {
$find->cash_price = bcadd($find->cash_price, $amount, 2);
$find->receivable = bcadd($find->receivable, $amount, 2);
if($source_mark){
$find->source_mark =$find->source_mark.','.$source_mark;
}
$find->save();
} else {
$model->store_id = $storeId;
$model->cash_price = $amount;
$model->receivable = $amount;
$model->remark = '银行转账请备注:'.mt_rand(1000, 9999);
$model->source_mark = $source_mark;
$model->status = YesNoEnum::NO; //收银台收了默认算完成了
$model->save();
}

View File

@ -495,6 +495,8 @@ class PayNotifyLogic extends BaseLogic
if ($order['other_uid'] > 0) {
$uid = $order['other_uid'];
}
$cashFlowLogic = new CashFlowLogic();
$cashFlowLogic->insert($order['store_id'], $order['price'],$orderSn);
PushService::push('wechat_mmp_' . $uid, $uid, ['type' => 'INDUSTRYMEMBERS', 'msg' => '订单支付成功', 'data' => ['id' => $order['id'], 'paid' => 1]]);
PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'INDUSTRYMEMBERS', 'msg' => '订单支付成功', 'data' => ['id' => $order['id'], 'paid' => 1]]);