order-profit:send 仅限微信分账订单
parent
11b6e0c1b8
commit
5227b83ac6
|
|
@ -54,6 +54,8 @@ class OrderProfitCommand extends Command
|
|||
->where('completed_at', '<', now()->subDays($saleDays))
|
||||
// 未支付提成
|
||||
->whereNull('profit_paid')
|
||||
// 微信分账订单
|
||||
->orderBy('wx_share->status', 'Y')
|
||||
->limit(10)
|
||||
->get();
|
||||
|
||||
|
|
@ -61,10 +63,9 @@ class OrderProfitCommand extends Command
|
|||
try {
|
||||
DB::beginTransaction();
|
||||
$service->wechatShare($order);
|
||||
// 分账成功, 更新订单状态
|
||||
$order->update(['profit_paid' => $now]);
|
||||
DB::commit();
|
||||
} catch (\Exception $e) {
|
||||
logger('app/Console/Commands/OrderProfitCommand error');
|
||||
DB::rollBack();
|
||||
report($e);
|
||||
$this->error($e->getMessage());
|
||||
|
|
|
|||
|
|
@ -251,7 +251,10 @@ class DistributeService
|
|||
}
|
||||
if ($status == 'FINISHED') {
|
||||
$attributes = ['share_sn' => $sn, 'status' => 'N'];
|
||||
$order->update(['wx_share' => $order->wx_share ? array_merge($order->wx_share, $attributes) : $attributes]);
|
||||
$order->update([
|
||||
'wx_share' => $order->wx_share ? array_merge($order->wx_share, $attributes) : $attributes,
|
||||
'profit_paid' => now(),
|
||||
]);
|
||||
$this->success($list, $result);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue