作者 何书鹏
1 个管道 的构建 通过 耗费 1 秒

完善代码

... ... @@ -479,6 +479,14 @@ class Order extends Api
*/
public function dealAction($order){
$grab = OrderGrab::where('order_id',$order['id'])->find();
// 给用户发送抢单成功通知
(new Message)->save([
'user_id' => $grab['user_id'],
'order_id' => $grab['order_id'],
'order_grab_id' => $grab['id'],
'type' => '1',
'grab_status' => '1',
]);
$grab->save(['status'=>'2','receive_time'=>time()]);
// 发单状态改为进行中
$order->save(['status'=>'2','order_grab_id'=>$grab['id']]);
... ...
... ... @@ -43,7 +43,7 @@ class OrderAutoOper extends BaseJob
if ($order['status'] == '3') {
\think\Db::transaction(function () use ($order) {
\app\api\controller\Order::comfirmAction($order);
\app\api\controller\Order::confirmAction($order);
});
}
... ...