|
|
@@ -230,45 +230,33 @@ class DouYinService
|
|
|
/**
|
|
|
* 扩展点回调提交订单
|
|
|
* @param $params
|
|
|
- * @return bool
|
|
|
* @throws \Exception
|
|
|
* @author liugc <466014217@qq.com>
|
|
|
* @date 2025/6/4 14:03
|
|
|
*/
|
|
|
public static function submitOrderNotify($params)
|
|
|
{
|
|
|
- Db::startTrans();
|
|
|
try {
|
|
|
// order_id goods total_amount discount cp_extra create_order_time phone_num contact_name open_id
|
|
|
-
|
|
|
- /*$params
|
|
|
-
|
|
|
- "order_id": "614167279916",
|
|
|
- "goods": [
|
|
|
- {
|
|
|
- "img_url": "http://xxx",
|
|
|
- "title": "xxx",
|
|
|
- "sub_title": "xxx",
|
|
|
- "labels": "过期退|随时退",
|
|
|
- "date_rule": "xxx",
|
|
|
- "origin_price": 800,
|
|
|
- "price": 750,
|
|
|
- "quantity": 2,
|
|
|
- "poi_id": "",
|
|
|
- "goods_id": "xxx",
|
|
|
- "item_order_id_list": [
|
|
|
- "1xxx",
|
|
|
- "2xxx"
|
|
|
- ]
|
|
|
- }
|
|
|
- ],*/
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- Db::commit();
|
|
|
- return true;
|
|
|
+ if(empty($params['user_info']['mobile'])){
|
|
|
+ throw new \Exception('手机号不能为空!');
|
|
|
+ }
|
|
|
+ // goods_id user_info.mobile user_id quantity
|
|
|
+ $order_number = self::submitOrder([
|
|
|
+ 'goods_id'=>$params['goods'][0]['goods_id'],
|
|
|
+ 'user_id'=>$params['user_id'],
|
|
|
+ 'user_info'=>$params['user_info'],
|
|
|
+ 'quantity'=>$params['goods'][0]['quantity']
|
|
|
+ ]);
|
|
|
+ return [
|
|
|
+ "outOrderNo" => $order_number,
|
|
|
+ "orderEntrySchema" => [
|
|
|
+ "path" => "page/index/index",
|
|
|
+ "params" => json_encode(['order_number' => $order_number])
|
|
|
+ ],
|
|
|
+ "payNotifyUrl" => config('douyin.payNotifyUrl')
|
|
|
+ ];
|
|
|
} catch (\Exception $e) {
|
|
|
- Db::rollback();
|
|
|
throw new \Exception($e->getMessage());
|
|
|
}
|
|
|
}
|
|
|
@@ -277,7 +265,7 @@ class DouYinService
|
|
|
|
|
|
/**
|
|
|
* 提交订单
|
|
|
- * @param array $params
|
|
|
+ * @param array $params goods_id user_info.mobile user_id quantity
|
|
|
* @return array|false
|
|
|
*/
|
|
|
public static function submitOrder($params)
|