Placeorder.php 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489
  1. <?php
  2. namespace app\admin\controller\store;
  3. use app\admin\controller\AuthController;
  4. use app\admin\model\order\StoreOrder as StoreOrderModel;
  5. use app\admin\model\order\StoreOrderStatus;
  6. use app\admin\model\system\ShippingTemplates;
  7. use app\admin\model\system\SystemStore;
  8. use app\models\store\StoreBargainUser;
  9. use app\models\store\StoreBargainUserHelp;
  10. use app\models\store\StoreCart;
  11. use app\models\store\StoreCouponUser;
  12. use app\models\store\StoreOrder;
  13. use app\models\store\StorePink;
  14. use app\models\system\CardInfo;
  15. use app\models\system\SystemStoreMember;
  16. use app\models\system\SystemStoreStock;
  17. use app\models\user\User;
  18. use app\models\user\UserAddress;
  19. use app\models\user\UserLevel;
  20. use app\Request;
  21. use crmeb\repositories\OrderRepository;
  22. use think\facade\Route as Url;
  23. use crmeb\services\{FormBuilder, UtilService as Util, JsonService as Json, UtilService};
  24. use app\admin\model\store\StoreProductAttrValue;
  25. /**
  26. *
  27. * Class Placeorder
  28. * @package app\admin\controller\store
  29. */
  30. class Placeorder extends AuthController
  31. {
  32. /**
  33. * 下单
  34. * @return string
  35. * @throws \think\db\exception\DataNotFoundException
  36. * @throws \think\db\exception\DbException
  37. * @throws \think\db\exception\ModelNotFoundException
  38. */
  39. public function index()
  40. {
  41. $store = [];
  42. if($this->adminInfo['type']==0)
  43. {
  44. $store = SystemStore::where('is_del',0)->where('is_show',1)->field('id,name')->select()->toArray();
  45. }
  46. else
  47. {
  48. $store = SystemStore::where('id',$this->adminInfo['store_id'])->field('id,name')->select();
  49. }
  50. $this->assign('store',$store);
  51. $this->assign('type',$this->adminInfo['type']);
  52. return $this->fetch();
  53. }
  54. /**
  55. * 获取会员卡
  56. * @param $card_no
  57. */
  58. public function getCardNo($card_no)
  59. {
  60. if($card_no=='') return app('json')->fail('会员码不能为空');
  61. if(intval($card_no)==1)
  62. {
  63. $info['user'] = User::where('uid', $card_no)->field("uid,real_name,addres , phone, '' as nickname, now_money,integral")->find();
  64. $info['uid'] = $info['user']['uid'];
  65. return app('json')->successful($info);
  66. }
  67. if(strlen($card_no) == 15)
  68. {
  69. $info = CardInfo::where(['type'=>1,'card_number'=>$card_no])->find();
  70. if(!$info) return app('json')->fail('充值卡号不存在');
  71. if($info['use_uid']==0) return app('json')->fail('充值卡未激活');
  72. $info['user'] = User::where('uid', $info['use_uid'])->field('uid,real_name,addres,phone,nickname,now_money,integral')->find();
  73. $info['uid'] = $info['user']['uid'];
  74. return app('json')->successful($info);
  75. }
  76. if(strlen($card_no) == 8 || strlen($card_no)==11)
  77. {
  78. if(!User::where('SN|phone', $card_no)->find()) return app('json')->fail('会员码不存在');
  79. $info['user'] = User::where('SN|phone', $card_no)->field('uid,real_name,addres,phone,nickname,now_money,integral')->find();
  80. $info['uid'] = $info['user']['uid'];
  81. }
  82. else
  83. {
  84. if(!SystemStoreMember::be(['card_no'=>$card_no])) return app('json')->fail('会员码不存在');
  85. $info = SystemStoreMember::where('card_no', $card_no)->find()->toArray();
  86. $info['user'] = User::where('uid', $info['uid'])->field('real_name,addres,phone,nickname,now_money,integral')->find();
  87. }
  88. return app('json')->successful($info);
  89. }
  90. /**
  91. * 获取条形码商品
  92. * @param string $bar_code
  93. * @return array|void
  94. * @throws \think\db\exception\DataNotFoundException
  95. * @throws \think\db\exception\DbException
  96. * @throws \think\db\exception\ModelNotFoundException
  97. */
  98. public function getBarCode($bar_code='')
  99. {
  100. if($bar_code=='') return $this->failed('条形码不存在');
  101. $info = SystemStoreStock::alias('a')->join("StoreProduct b","a.product_id=b.id","left")->where('a.bar_code',$bar_code)->field('a.price,a.unique,a.in_stock,a.is_consumer,a.product_id,b.store_name,b.image')->find();
  102. if($info)
  103. {
  104. $info = $info->toArray();
  105. $info['suk'] = StoreProductAttrValue::where('unique',$info['unique'])->value('suk');
  106. }
  107. else
  108. {
  109. $info = StoreProductAttrValue::alias('a')->join("StoreProduct b","a.product_id=b.id","left")->where('a.bar_code',$bar_code)->field('a.price,a.unique,0 as in_stock,b.is_consumer,a.product_id,b.store_name,b.image')->find();
  110. if($info)
  111. {
  112. $info = $info->toArray();
  113. }
  114. else
  115. {
  116. $info = [];
  117. }
  118. }
  119. return app('json')->successful($info);
  120. }
  121. /**
  122. * 增加购物车
  123. * @param $data
  124. * @return mixed
  125. * @throws \think\db\exception\DataNotFoundException
  126. * @throws \think\db\exception\ModelNotFoundException
  127. */
  128. public function add_cart()
  129. {
  130. list($productId, $cartNum, $uniqueId, $combinationId, $secKillId, $bargainId, $new,$uid) = UtilService::postMore([
  131. ['productId',0],//普通产品编号
  132. ['cartNum',1], //购物车数量
  133. ['uniqueId',''],//属性唯一值
  134. ['combinationId',0],//拼团产品编号
  135. ['secKillId',0],//秒杀产品编号
  136. ['bargainId',0],//砍价产品编号
  137. ['new',1], // 1 加入购物车直接购买 0 加入购物车
  138. ['uid',0],//用户编号
  139. ], $this->request, true);
  140. $request = $this->request;
  141. if (!$productId || !is_numeric($productId)) return app('json')->fail('参数错误');
  142. if ($bargainId && StoreBargainUserHelp::getSurplusPrice($bargainId, $uid)) return app('json')->fail('请先砍价');
  143. $res = StoreCart::setCart($uid, $productId, $cartNum, $uniqueId, 'product', $new, $combinationId, $secKillId, $bargainId);
  144. if (!$res) return app('json')->fail(StoreCart::getErrorInfo());
  145. else return app('json')->successful('ok', ['cartId' => $res->id]);
  146. }
  147. /**
  148. * 清空购物车
  149. * @return mixed
  150. * @throws \Exception
  151. */
  152. public function clear_cart()
  153. {
  154. list($uid) = UtilService::postMore([
  155. ['uid',0],//用户编号
  156. ], $this->request, true);
  157. $is_pay = 0;
  158. StoreCart::where(compact('uid','is_pay'))->delete();
  159. return app('json')->successful('清空完成!');
  160. }
  161. /**
  162. * 购物车 删除产品
  163. * @param Request $request
  164. * @return mixed
  165. */
  166. public function del(Request $request)
  167. {
  168. list($ids,$uid) = UtilService::postMore([
  169. ['ids',[]],//购物车编号
  170. ['uid',0],
  171. ], $request, true);
  172. if (!count($ids))
  173. return app('json')->fail('参数错误!');
  174. if(StoreCart::removeUserCart($uid, $ids))
  175. return app('json')->successful();
  176. return app('json')->fail('清除失败!');
  177. }
  178. /**
  179. * 购物车 修改产品数量
  180. * @param Request $request
  181. * @return mixed
  182. * @throws \think\Exception
  183. * @throws \think\db\exception\DataNotFoundException
  184. * @throws \think\db\exception\ModelNotFoundException
  185. * @throws \think\exception\DbException
  186. */
  187. public function num(Request $request)
  188. {
  189. list($id, $number,$uid) = UtilService::postMore([
  190. ['id',0],//购物车编号
  191. ['number',0],//购物车编号
  192. ['uid',0],
  193. ], $request, true);
  194. if (!$id || !$number || !is_numeric($id) || !is_numeric($number)) return app('json')->fail('参数错误!');
  195. $res = StoreCart::changeUserCartNum($id, $number, $uid);
  196. if ($res) return app('json')->successful();
  197. else return app('json')->fail(StoreCart::getErrorInfo('修改失败'));
  198. }
  199. /**
  200. * 订单确认
  201. * @return mixed
  202. * @throws \Psr\SimpleCache\InvalidArgumentException
  203. * @throws \think\db\exception\DataNotFoundException
  204. * @throws \think\db\exception\DbException
  205. * @throws \think\db\exception\ModelNotFoundException
  206. */
  207. public function confirm()
  208. {
  209. $request = $this->request;
  210. $temp = ShippingTemplates::get(1);
  211. if (!$temp) return app('json')->fail('默认模板未配置,无法下单');
  212. list($cartId) = UtilService::postMore(['cartId'], $request, true);
  213. if (!is_string($cartId) || !$cartId) return app('json')->fail('请提交购买的商品');
  214. $uid = input('uid',0);
  215. $cartGroup = StoreCart::getUserProductCartList($uid, $cartId, 1);
  216. if (count($cartGroup['invalid'])) return app('json')->fail($cartGroup['invalid'][0]['productInfo']['store_name'] . '已失效!');
  217. if (!$cartGroup['valid']) return app('json')->fail('请提交购买的商品');
  218. $cartInfo = $cartGroup['valid'];
  219. $addr = UserAddress::where('uid', $uid)->where('is_default', 1)->find();
  220. $priceGroup = StoreOrder::getOrderPriceGroup($cartInfo, $addr);
  221. if ($priceGroup === false) {
  222. return app('json')->fail(StoreOrder::getErrorInfo('运费模板不存在'));
  223. }
  224. $other = [
  225. 'offlinePostage' => sys_config('offline_postage'),
  226. 'integralRatio' => sys_config('integral_ratio')
  227. ];
  228. $usableCoupons = StoreCouponUser::getUsableCouponList($uid, $cartGroup, $priceGroup['totalPrice']);
  229. $usableCoupon = isset($usableCoupons[0]) ? $usableCoupons[0] : null;
  230. $cartIdA = explode(',', $cartId);
  231. $seckill_id = 0;
  232. $combination_id = 0;
  233. $bargain_id = 0;
  234. if (count($cartIdA) == 1) {
  235. $seckill_id = StoreCart::where('id', $cartId)->value('seckill_id');
  236. $combination_id = StoreCart::where('id', $cartId)->value('combination_id');
  237. $bargain_id = StoreCart::where('id', $cartId)->value('bargain_id');
  238. }
  239. $data['deduction'] = $seckill_id || $combination_id || $bargain_id;
  240. $data['usableCoupon'] = $usableCoupon;
  241. $data['addressInfo'] = UserAddress::getUserDefaultAddress($uid);
  242. $data['seckill_id'] = $seckill_id;
  243. $data['combination_id'] = $combination_id;
  244. $data['bargain_id'] = $bargain_id;
  245. $data['cartInfo'] = $cartInfo;
  246. $data['priceGroup'] = $priceGroup;
  247. $data['orderKey'] = StoreOrder::cacheOrderInfo($uid, $cartInfo, $priceGroup, $other);
  248. $data['offlinePostage'] = $other['offlinePostage'];
  249. $vipId = UserLevel::getUserLevel($uid);
  250. $user = User::find($uid);
  251. if (isset($user['pwd'])) unset($user['pwd']);
  252. $user['vip'] = $vipId !== false ? true : false;
  253. if ($user['vip']) {
  254. $user['vip_id'] = $vipId;
  255. $user['discount'] = UserLevel::getUserLevelInfo($vipId, 'discount');
  256. }
  257. $data['userInfo'] = $user;
  258. $data['integralRatio'] = $other['integralRatio'];
  259. $data['offline_pay_status'] = (int)sys_config('offline_pay_status') ?? (int)2;
  260. $data['store_self_mention'] = (int)sys_config('store_self_mention') ?? 0;//门店自提是否开启
  261. $data['system_store'] = ($res = \app\models\system\SystemStore::getStoreDispose()) ? $res : [];//门店信息
  262. return app('json')->successful($data);
  263. }
  264. /**
  265. * 计算订单金额
  266. * @param Request $request
  267. * @param $key
  268. * @return mixed
  269. * @throws \think\Exception
  270. * @throws \think\db\exception\DataNotFoundException
  271. * @throws \think\db\exception\ModelNotFoundException
  272. * @throws \think\exception\DbException
  273. */
  274. public function computedOrder($key)
  275. {
  276. $request = $this->request;
  277. $uid = input('uid',0);
  278. if (!$key) return app('json')->fail('参数错误!');
  279. if (StoreOrder::be(['order_id|unique' => $key, 'uid' => $uid, 'is_del' => 0]))
  280. return app('json')->status('extend_order', '订单已生成', ['orderId' => $key, 'key' => $key]);
  281. list($addressId, $couponId, $payType, $useIntegral, $mark, $combinationId, $pinkId, $seckill_id, $formId, $bargainId, $shipping_type) = UtilService::postMore([
  282. 'addressId', 'couponId', ['payType', 'yue'], ['useIntegral', 0], 'mark', ['combinationId', 0], ['pinkId', 0], ['seckill_id', 0], ['formId', ''], ['bargainId', ''],
  283. ['shipping_type', 1],
  284. ], $request, true);
  285. $payType = strtolower($payType);
  286. if ($bargainId) {
  287. $bargainUserTableId = StoreBargainUser::getBargainUserTableId($bargainId, $uid);//TODO 获取用户参与砍价表编号
  288. if (!$bargainUserTableId)
  289. return app('json')->fail('砍价失败');
  290. $status = StoreBargainUser::getBargainUserStatusEnd($bargainUserTableId);
  291. if ($status == 3)
  292. return app('json')->fail('砍价已支付');
  293. StoreBargainUser::setBargainUserStatus($bargainId, $uid); //修改砍价状态
  294. }
  295. if ($pinkId) {
  296. $cache_pink = Cache::get(md5('store_pink_'.$pinkId));
  297. if($cache_pink && bcsub($cache_pink['people'], $cache_pink['now_people'], 0) <= 0){
  298. return app('json')->status('ORDER_EXIST', '订单生成失败,该团人员已满', ['orderId' => StoreOrder::getStoreIdPink($pinkId, $uid)]);
  299. }
  300. if (StorePink::getIsPinkUid($pinkId, $uid))
  301. return app('json')->status('ORDER_EXIST', '订单生成失败,你已经在该团内不能再参加了', ['orderId' => StoreOrder::getStoreIdPink($pinkId, $uid)]);
  302. if (StoreOrder::getIsOrderPink($pinkId, $uid))
  303. return app('json')->status('ORDER_EXIST', '订单生成失败,你已经参加该团了,请先支付订单', ['orderId' => StoreOrder::getStoreIdPink($pinkId, $uid)]);
  304. }
  305. $priceGroup = StoreOrder::cacheKeyCreateOrder($uid, $key, $addressId, $payType, (int)$useIntegral, $couponId, $mark, $combinationId, $pinkId, $seckill_id, $bargainId, true, 0, $shipping_type);
  306. if ($priceGroup)
  307. return app('json')->status('NONE', 'ok', $priceGroup);
  308. else
  309. return app('json')->fail(StoreOrder::getErrorInfo('计算失败'));
  310. }
  311. /**
  312. * 订单创建
  313. * @param Request $request
  314. * @param $key
  315. * @return mixed
  316. * @throws \think\Exception
  317. * @throws \think\db\exception\DataNotFoundException
  318. * @throws \think\db\exception\ModelNotFoundException
  319. * @throws \think\exception\DbException
  320. */
  321. public function create($key)
  322. {
  323. $request = $this->request;
  324. $uid = input('uid',0);
  325. if (!$key) return app('json')->fail('参数错误!');
  326. if (StoreOrder::be(['order_id|unique' => $key, 'uid' => $uid, 'is_del' => 0]))
  327. return app('json')->status('extend_order', '订单已生成', ['orderId' => $key, 'key' => $key]);
  328. list($addressId, $couponId, $payType, $useIntegral, $mark, $combinationId, $pinkId, $seckill_id, $formId, $bargainId, $from, $shipping_type, $real_name, $phone, $storeId,$auth_code) = UtilService::postMore([
  329. 'addressId', 'couponId', 'payType', ['useIntegral', 0], 'mark', ['combinationId', 0], ['pinkId', 0], ['seckill_id', 0], ['formId', ''], ['bargainId', ''], ['from', 'weixin'],
  330. ['shipping_type', 1], ['real_name', '散户'], ['phone', '18700010001'], ['store_id', 0],['auth_code',''],
  331. ], $request, true);
  332. if(empty($real_name))$real_name='散户';
  333. if(empty($phone))$phone='18700010001';
  334. $payType = strtolower($payType);
  335. if ($bargainId) {
  336. $bargainUserTableId = StoreBargainUser::getBargainUserTableId($bargainId, $uid);//TODO 获取用户参与砍价表编号
  337. if (!$bargainUserTableId)
  338. return app('json')->fail('砍价失败');
  339. $status = StoreBargainUser::getBargainUserStatusEnd($bargainUserTableId);
  340. if ($status == 3)
  341. return app('json')->fail('砍价已支付');
  342. StoreBargainUser::setBargainUserStatus($bargainId, $uid); //修改砍价状态
  343. }
  344. if ($pinkId) {
  345. $cache_pink = Cache::get(md5('store_pink_'.$pinkId));
  346. if($cache_pink && bcsub($cache_pink['people'], $cache_pink['now_people'], 0) <= 0){
  347. return app('json')->status('ORDER_EXIST', '订单生成失败,该团人员已满', ['orderId' => StoreOrder::getStoreIdPink($pinkId, $uid)]);
  348. }
  349. if (StorePink::getIsPinkUid($pinkId, $uid))
  350. return app('json')->status('ORDER_EXIST', '订单生成失败,你已经在该团内不能再参加了', ['orderId' => StoreOrder::getStoreIdPink($pinkId, $uid)]);
  351. if (StoreOrder::getIsOrderPink($pinkId, $uid))
  352. return app('json')->status('ORDER_EXIST', '订单生成失败,你已经参加该团了,请先支付订单', ['orderId' => StoreOrder::getStoreIdPink($pinkId, $uid)]);
  353. }
  354. $isChannel = 1;
  355. if ($from == 'weixin')
  356. $isChannel = 0;
  357. elseif ($from == 'weixinh5')
  358. $isChannel = 2;
  359. $order = StoreOrder::cacheKeyCreateOrder($uid, $key, $addressId, $payType, (int)$useIntegral, $couponId, $mark, $combinationId, $pinkId, $seckill_id, $bargainId, false, $isChannel, $shipping_type, $real_name, $phone, $storeId);
  360. if ($order === false) return app('json')->fail(StoreOrder::getErrorInfo('订单生成失败'));
  361. $orderId = $order['order_id'];
  362. $info = compact('orderId', 'key');
  363. if ($orderId) {
  364. event('OrderCreated', [$order]); //订单创建成功事件
  365. // event('ShortMssageSend', [$orderId, 'AdminPlaceAnOrder']);//发送管理员通知
  366. switch ($payType) {
  367. case "weixin":
  368. $orderInfo = StoreOrder::where('order_id', $orderId)->find();
  369. if (!$orderInfo || !isset($orderInfo['paid'])) return app('json')->fail('支付订单不存在!');
  370. $orderInfo = $orderInfo->toArray();
  371. if ($orderInfo['paid']) return app('json')->fail('支付已支付!');
  372. //支付金额为0
  373. if (bcsub((float)$orderInfo['pay_price'], 0, 2) <= 0) {
  374. //创建订单jspay支付
  375. $payPriceStatus = StoreOrder::jsPayPrice($orderId, $uid, $formId);
  376. if ($payPriceStatus)//0元支付成功
  377. return app('json')->status('success', '微信支付成功', $info);
  378. else
  379. return app('json')->status('pay_error', StoreOrder::getErrorInfo());
  380. } else {
  381. try {
  382. $jsConfig = OrderRepository::barcodePay($orderId,$auth_code); //创建订单jspay
  383. } catch (\Exception $e) {
  384. return app('json')->status('pay_error', $e->getMessage(), $info);
  385. }
  386. $info['jsConfig'] = $jsConfig;
  387. if ($from == 'weixinh5') {
  388. return app('json')->status('wechat_h5_pay', '订单创建成功', $info);
  389. } else {
  390. return app('json')->status('wechat_pay', '订单创建成功', $info);
  391. }
  392. }
  393. break;
  394. case 'yue':
  395. if (StoreOrder::yuePay($orderId, $uid, $formId)) {
  396. $orderInfo = StoreOrder::where('order_id', $orderId)->find();
  397. $this->verify($orderInfo['id']);
  398. return app('json')->status('success', '余额支付成功', $info);
  399. }
  400. else {
  401. $errorinfo = StoreOrder::getErrorInfo();
  402. if (is_array($errorinfo))
  403. return app('json')->status($errorinfo['status'], $errorinfo['msg'], $info);
  404. else
  405. return app('json')->status('pay_error', $errorinfo);
  406. }
  407. break;
  408. case 'offline':
  409. $orderInfo = StoreOrder::where('order_id', $orderId)->find();
  410. $this->offline($orderInfo['id']);
  411. $this->verify($orderInfo['id']);
  412. return app('json')->status('success', '订单创建成功', $info);
  413. break;
  414. case 'jialie':
  415. $orderInfo = StoreOrder::where('order_id', $orderId)->find();
  416. if (!$orderInfo || !isset($orderInfo['paid'])) return app('json')->fail('支付订单不存在!');
  417. $orderInfo = $orderInfo->toArray();
  418. if ($orderInfo['paid']) return app('json')->fail('支付已支付!');
  419. $rs = OrderRepository::jialiePay($orderId,$auth_code); //支付结果
  420. if($rs['ret_code']=="00" && $rs['status']=="2")
  421. {
  422. $this->verify($orderInfo['id']);
  423. StoreOrder::paySuccess($orderId,'jialie');
  424. }
  425. elseif($rs['ret_code']=="00" && $rs['status']==1)
  426. {
  427. StoreOrder::edit(['jialie_do'=>1],$orderInfo['id']);
  428. }
  429. else
  430. {
  431. return app('json')->fail($rs['ret_msg']);
  432. }
  433. return app('json')->status('success', '订单创建成功', $info);
  434. break;
  435. }
  436. } else return app('json')->fail(StoreOrder::getErrorInfo('订单生成失败!'));
  437. }
  438. public function verify($id)
  439. {
  440. StoreOrderModel::beginTrans();
  441. $orderInfo = StoreOrderModel::where('id', $id)->find();
  442. if ($orderInfo->combination_id && $orderInfo->pink_id) {
  443. $res = \app\admin\model\ump\StorePink::where('id', $orderInfo->pink_id)->where('status', '<>', 2)->count();
  444. if ($res) return Json::fail('拼团订单暂未成功无法核销!');
  445. }
  446. $orderInfo->status = 2;
  447. if ($orderInfo->save()) {
  448. OrderRepository::storeProductOrderTakeDeliveryAdmin($orderInfo);
  449. StoreOrderStatus::setStatus($orderInfo->id, 'take_delivery', '已核销');
  450. StoreOrderModel::commitTrans();
  451. return true;
  452. } else {
  453. StoreOrderModel::rollbackTrans();
  454. return false;
  455. }
  456. }
  457. /**
  458. * 立即支付
  459. * @param $id
  460. */
  461. public function offline($id)
  462. {
  463. $res = StoreOrderModel::updateOffline($id);
  464. if ($res) {
  465. event('StoreProductOrderOffline', [$id]);
  466. StoreOrderStatus::setStatus($id, 'offline', '线下付款');
  467. return true;
  468. } else {
  469. return false;
  470. }
  471. }
  472. }