|
@@ -568,26 +568,6 @@ class PaymentService extends BaseService
|
|
|
$this->error = '付款处理失败';
|
|
$this->error = '付款处理失败';
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 统计总消费
|
|
|
|
|
- $id = AccountStatisticsModel::where(['user_id'=>$orderUserId])->orderBy('id','desc')->value('id');
|
|
|
|
|
- $updateData = [
|
|
|
|
|
- 'expend'=>DB::raw("expend + {$payTotal}"),
|
|
|
|
|
- 'updated_at'=>date('Y-m-d H:i:s')
|
|
|
|
|
- ];
|
|
|
|
|
- if($id){
|
|
|
|
|
- if(!AccountStatisticsModel::where(['id'=>$id])->update($updateData)){
|
|
|
|
|
- Db::rollBack();
|
|
|
|
|
- $this->error = '统计处理失败';
|
|
|
|
|
- }
|
|
|
|
|
- }else{
|
|
|
|
|
- $updateData['expend'] = $payTotal;
|
|
|
|
|
- $updateData['user_id'] = $orderUserId;
|
|
|
|
|
- $updateData['created_at'] = date('Y-m-d H:i:s');
|
|
|
|
|
- if(!AccountStatisticsModel::insertGetId($updateData)){
|
|
|
|
|
- Db::rollBack();
|
|
|
|
|
- $this->error = '统计处理失败';
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
break;
|
|
break;
|
|
|
default:
|
|
default:
|
|
|
break;
|
|
break;
|
|
@@ -714,7 +694,7 @@ class PaymentService extends BaseService
|
|
|
|
|
|
|
|
$pay = PaymentService::make()->createPay($scene, 10);
|
|
$pay = PaymentService::make()->createPay($scene, 10);
|
|
|
$plugin = $pay->mergeCommonPlugins([
|
|
$plugin = $pay->mergeCommonPlugins([
|
|
|
- AddReceiverPlugin::class
|
|
|
|
|
|
|
+ \Yansongda\Pay\Plugin\Wechat\V3\Extend\ProfitSharing\AddReceiverPlugin::class
|
|
|
], $data);
|
|
], $data);
|
|
|
|
|
|
|
|
// 添加分账插件配置
|
|
// 添加分账插件配置
|
|
@@ -742,7 +722,7 @@ class PaymentService extends BaseService
|
|
|
|
|
|
|
|
// 创建分账数据
|
|
// 创建分账数据
|
|
|
$createPlugin = $pay->mergeCommonPlugins([
|
|
$createPlugin = $pay->mergeCommonPlugins([
|
|
|
- CreatePlugin::class
|
|
|
|
|
|
|
+ \Yansongda\Pay\Plugin\Alipay\V2\Pay\Scan\CreatePlugin::class
|
|
|
], $postData);
|
|
], $postData);
|
|
|
|
|
|
|
|
// 发起分账
|
|
// 发起分账
|