diff --git a/crmeb/app/api/controller/v1/order/StoreOrderController.php b/crmeb/app/api/controller/v1/order/StoreOrderController.php index 3c1087e5d..f27603e93 100644 --- a/crmeb/app/api/controller/v1/order/StoreOrderController.php +++ b/crmeb/app/api/controller/v1/order/StoreOrderController.php @@ -211,9 +211,13 @@ class StoreOrderController } /** + * @param Request $request * @param $orderId * @param string $type * @return \think\Response + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException * @author 等风来 * @email 136327134@qq.com * @date 2023/2/13 @@ -223,7 +227,6 @@ class StoreOrderController if (!$orderId) { return app('json')->fail(100100); } - return app('json')->success($this->services->getCashierInfo((int)$request->uid(), $orderId, $type)); } @@ -247,6 +250,7 @@ class StoreOrderController if (!$uni) return app('json')->fail(100100); $orderInfo = $this->services->get(['order_id' => $uni]); $uid = $type == 1 ? (int)$request->uid() : $orderInfo->uid; + $orderInfo->is_channel = $this->getChennel[$request->getFromType()] ?? ($request->isApp() ? 0 : 1); $orderInfo->pay_uid = $uid; $orderInfo->save(); $orderInfo = $orderInfo->toArray(); @@ -260,7 +264,7 @@ class StoreOrderController } //重新生成订单号去支付 - $order['order_id'] = mt_rand(100, 999) . '_' . $order['order_id']; +// $order['order_id'] = mt_rand(100, 999) . '_' . $order['order_id']; //0元支付 if (bcsub((string)$orderInfo['pay_price'], '0', 2) <= 0) { diff --git a/crmeb/app/dao/article/ArticleCategoryDao.php b/crmeb/app/dao/article/ArticleCategoryDao.php index 83e181126..9abee485c 100644 --- a/crmeb/app/dao/article/ArticleCategoryDao.php +++ b/crmeb/app/dao/article/ArticleCategoryDao.php @@ -73,7 +73,6 @@ class ArticleCategoryDao extends BaseDao ->where('hidden', 0) ->where('is_del', 0) ->where('status', 1) - ->where('pid', '>', 0) ->order('sort DESC') ->field('id,pid,title') ->select()->toArray(); diff --git a/crmeb/app/services/order/StoreOrderCreateServices.php b/crmeb/app/services/order/StoreOrderCreateServices.php index 40d6edcf4..8686d5f38 100644 --- a/crmeb/app/services/order/StoreOrderCreateServices.php +++ b/crmeb/app/services/order/StoreOrderCreateServices.php @@ -75,11 +75,11 @@ class StoreOrderCreateServices extends BaseServices $id = $snowflake->setStartTimeStamp(strtotime('2022-01-01') * 1000)->id(); } $replace = ''; - $chars = 'abcdefghijklmnopqrstuvwxyz0123456789'; - for ($i = 0; $i < 3; $i++) { + $chars = '0123456789'; + for ($i = 0; $i < 6; $i++) { $replace .= $chars[mt_rand(0, strlen($chars) - 1)]; } - $id = substr_replace($id, $replace, -3); + $id = substr_replace($id, $replace, -6); } else { $is_callable = function ($currentTime) { $redis = Cache::store('redis'); @@ -281,10 +281,8 @@ class StoreOrderCreateServices extends BaseServices } /** @var StoreOrderCartInfoServices $cartServices */ $cartServices = app()->make(StoreOrderCartInfoServices::class); - /** @var StoreSeckillServices $seckillServices */ - $seckillServices = app()->make(StoreSeckillServices::class); $priceData['coupon_id'] = $couponId; - $order = $this->transaction(function () use ($cartIds, $orderInfo, $cartInfo, $key, $userInfo, $useIntegral, $priceData, $combinationId, $seckillId, $bargainId, $cartServices, $seckillServices, $uid, $addressId, $advanceId) { + $order = $this->transaction(function () use ($cartIds, $orderInfo, $cartInfo, $key, $userInfo, $useIntegral, $priceData, $combinationId, $seckillId, $bargainId, $cartServices, $uid, $addressId, $advanceId) { //创建订单 $order = $this->dao->save($orderInfo); if (!$order) { diff --git a/crmeb/app/services/order/StoreOrderServices.php b/crmeb/app/services/order/StoreOrderServices.php index cfb69597c..1d653a599 100644 --- a/crmeb/app/services/order/StoreOrderServices.php +++ b/crmeb/app/services/order/StoreOrderServices.php @@ -768,7 +768,7 @@ HTML; } /** @var StoreOrderCreateServices $createServices */ $createServices = app()->make(StoreOrderCreateServices::class); - $data['order_id'] = $createServices->getNewOrderId(); + $data['order_id'] = $createServices->getNewOrderId('cp'); /** @var StoreOrderStatusServices $services */ $services = app()->make(StoreOrderStatusServices::class); return $this->transaction(function () use ($id, $data, $services) { @@ -2599,6 +2599,7 @@ HTML; } /** + * @param int $uid * @param string $orderId * @param string $type * @return array @@ -2630,14 +2631,14 @@ HTML; if (!$info) { throw new PayException('您支付的订单不存在'); } - $orderCancelTime = (int)sys_config('order_cancel_time', 0); - $orderActivityTime = (int)sys_config('order_activity_time', 0); + $orderCancelTime = sys_config('order_cancel_time', 0); + $orderActivityTime = sys_config('order_activity_time', 0); if ($info->combination_id) { - $time = ((int)sys_config('order_pink_time', 0) ?: $orderActivityTime) * 60 * 60 + ((int)$info->add_time); + $time = (sys_config('order_pink_time', 0) ?: $orderActivityTime) * 60 * 60 + ((int)$info->add_time); } else if ($info->seckill_id) { - $time = ((int)sys_config('order_seckill_time', 0) ?: $orderActivityTime) * 60 * 60 + ((int)$info->add_time); + $time = (sys_config('order_seckill_time', 0) ?: $orderActivityTime) * 60 * 60 + ((int)$info->add_time); } else if ($info->bargain_id) { - $time = ((int)sys_config('order_bargain_time', 0) ?: $orderActivityTime) * 60 * 60 + ((int)$info->add_time); + $time = (sys_config('order_bargain_time', 0) ?: $orderActivityTime) * 60 * 60 + ((int)$info->add_time); } else { $time = $orderCancelTime * 60 * 60 + ((int)$info->add_time); } diff --git a/crmeb/app/services/product/product/StoreProductServices.php b/crmeb/app/services/product/product/StoreProductServices.php index 3ac57dfb6..1de8d206b 100644 --- a/crmeb/app/services/product/product/StoreProductServices.php +++ b/crmeb/app/services/product/product/StoreProductServices.php @@ -654,7 +654,7 @@ class StoreProductServices extends BaseServices //采集商品下载图片 if ($type == -1) { - $s_image_down = $d_image_down = []; + $s_image_down = []; //下载商品轮播图 foreach ($slider_image as $s_image) { if (sys_config('queue_open', 0) == 1) { @@ -671,8 +671,7 @@ class StoreProductServices extends BaseServices if (sys_config('queue_open', 0) == 1) { ProductCopyJob::dispatch('copyDescriptionImage', [$res->id, $description, $d_image, count($match[1])]); } else { - if (!is_int(strpos($d_image, 'http'))) $d_image = 'http://' . ltrim($d_image, '\//'); - $d_image_down[] = $d_img = app()->make(CopyTaobaoServices::class)->downloadCopyImage($d_image); + $d_img = app()->make(CopyTaobaoServices::class)->downloadCopyImage(!is_int(strpos($d_image, 'http')) ? 'http://' . ltrim($d_image, '\//') : $d_image); $description = str_replace($d_image, $d_img, $description); } } diff --git a/template/uni-app/pages/goods/order_details/index.vue b/template/uni-app/pages/goods/order_details/index.vue index faa47261b..7e2fe43ee 100644 --- a/template/uni-app/pages/goods/order_details/index.vue +++ b/template/uni-app/pages/goods/order_details/index.vue @@ -359,7 +359,7 @@ hover-class='none' :url="'/pages/goods/goods_logistics/index?orderId='+ orderInfo.order_id"> {{$t(`查看物流`)}} - {{$t(`查看拼团`)}}