diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index e6cecfa7..90911378 100644 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -281,6 +281,15 @@ class Auth extends BaseController return app('json')->fail('用户店铺异常'); } $repository = app()->make(StoreOrderRepository::class); + $orderSn = "bzj" . date('YmdHis') . uniqid(); + Db::name('margin_order')->insert([ + 'uid' => $user['uid'], + 'mer_id' => $merchant['mer_id'], + 'order_sn' => $orderSn, + 'total_price' => $merchant['margin'], + 'pay_type' => 1, + 'create_time' => date('Y-m-d H:i:s') + ]); $param = [ "status" => 0, "is_del" => 0, @@ -289,7 +298,7 @@ class Auth extends BaseController "attach" => "margin", "order_info" => '{"is_margin":1,"margin":"' . $merchant['margin'] . '"}', "pay_price" => $merchant['margin'], - "order_sn" => "bzj" . date('YmdHis') . uniqid(), + "order_sn" => $orderSn, "body" => $merchant['mer_name'] . ' - ' . $merchant['margin'], ]; $payType = 'weixinApp';