diff --git a/crmeb/app/api/controller/store/StoreProductController.php b/crmeb/app/api/controller/store/StoreProductController.php index a647888f..8c6ebd5c 100644 --- a/crmeb/app/api/controller/store/StoreProductController.php +++ b/crmeb/app/api/controller/store/StoreProductController.php @@ -46,10 +46,6 @@ class StoreProductController * @param Request $request * @param $id * @return mixed - * @throws \think\Exception - * @throws \think\db\exception\DataNotFoundException - * @throws \think\db\exception\ModelNotFoundException - * @throws \think\exception\DbException */ public function code(Request $request, $id) { @@ -103,6 +99,17 @@ class StoreProductController } } + /** + * 产品详情 + * @param Request $request + * @param $id + * @param int $type + * @return mixed + * @throws \think\Exception + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\ModelNotFoundException + * @throws \think\exception\DbException + */ public function detail(Request $request, $id,$type = 0) { if (!$id || !($storeInfo = StoreProduct::getValidProduct($id))) return app('json')->fail('商品不存在或已下架'); @@ -167,7 +174,7 @@ class StoreProductController $data['system_store'] = ($res = SystemStore::getStoreDispose()) ? $res : []; $data['good_list'] = StoreProduct::getGoodList(18,'image,store_name,price,id,ot_price'); $data['mapKey'] = sysConfig('tengxun_map_key'); - $data['store_self_mention']= (int)sysConfig('store_self_mention') ?? 0;//门店自提是否开启 + $data['store_self_mention'] = (int)sysConfig('store_self_mention') ?? 0;//门店自提是否开启 return app('json')->successful($data); } diff --git a/crmeb/app/models/store/StoreOrder.php b/crmeb/app/models/store/StoreOrder.php index 03819a62..345e4f0a 100644 --- a/crmeb/app/models/store/StoreOrder.php +++ b/crmeb/app/models/store/StoreOrder.php @@ -335,7 +335,7 @@ class StoreOrder extends BaseModel } $orderInfo = [ 'uid' => $uid, - 'order_id' => $test ? 0 : self::getNewOrderId($uid), + 'order_id' => $test ? 0 : self::getNewOrderId(), 'real_name' => $addressInfo['real_name'], 'user_phone' => $addressInfo['phone'], 'user_address' => $addressInfo['province'] . ' ' . $addressInfo['city'] . ' ' . $addressInfo['district'] . ' ' . $addressInfo['detail'], @@ -490,10 +490,10 @@ class StoreOrder extends BaseModel * @param $uid 用户uid * @return string */ - public static function getNewOrderId($uid) + public static function getNewOrderId() { list($msec, $sec) = explode(' ', microtime()); - $msectime = (float)sprintf('%.0f', (floatval($msec) + floatval($sec)) * 1000); + $msectime = number_format((floatval($msec) + floatval($sec)) * 1000,0,'',''); $orderId = 'wx' . $msectime . mt_rand(10000,99999); if(self::be(['order_id'=>$orderId])) $orderId = 'wx' . $msectime . mt_rand(10000,99999); return $orderId; diff --git a/crmeb/crmeb/subscribes/OrderSubscribe.php b/crmeb/crmeb/subscribes/OrderSubscribe.php index e87551f2..c750e42d 100644 --- a/crmeb/crmeb/subscribes/OrderSubscribe.php +++ b/crmeb/crmeb/subscribes/OrderSubscribe.php @@ -133,8 +133,9 @@ class OrderSubscribe //检测会员等级 event('UserLevelAfter', [$order['uid']]); - - //向后台发送新订单消息 - ChannelService::instance()->send('NEW_ORDER', ['order_id'=>$order['order_id']]); + try{ + //向后台发送新订单消息 + ChannelService::instance()->send('NEW_ORDER', ['order_id'=>$order['order_id']]); + }catch (\Throwable $e){} } } \ No newline at end of file