Bläddra i källkod

fix 修复无法进行0元下单的问题,修复导出商品的时候无法正常选择性导出的问题

吴昊天 2 år sedan
förälder
incheckning
3c07f02184

+ 2 - 1
crmeb/app/adminapi/controller/v1/export/ExportExcel.php

@@ -110,7 +110,8 @@ class ExportExcel extends AuthController
         $where = $this->request->getMore([
             ['store_name', ''],
             ['cate_id', ''],
-            ['type', 1]
+            ['type', 1],
+            ['ids', []]
         ]);
         return app('json')->success($this->service->exportProductList($where));
     }

+ 2 - 1
crmeb/app/api/controller/v1/order/StoreOrderController.php

@@ -409,6 +409,7 @@ class StoreOrderController
         $uid = $type == 1 ? (int)$request->uid() : $orderInfo->uid;
         $orderInfo->pay_uid = $uid;
         $orderInfo->save();
+        $orderInfo = $orderInfo->toArray();
         $order = $this->services->get(['order_id' => $uni]);
         if (!$order)
             return app('json')->fail(410173);
@@ -455,7 +456,7 @@ class StoreOrderController
             $success = app()->make(StoreOrderSuccessServices::class);
             $payPriceStatus = $success->zeroYuanPayment($orderInfo, $uid, $paytype);
             if ($payPriceStatus)//0元支付成功
-                return app('json')->status('success', 410195, ['order_id' => $orderInfo['order_id'], 'key' => $orderInfo['unique ']]);
+                return app('json')->status('success', 410195, ['order_id' => $orderInfo['order_id'], 'key' => $orderInfo['unique']]);
             else
                 return app('json')->status('pay_error');
         }

+ 10 - 0
crmeb/app/model/product/product/StoreProduct.php

@@ -338,6 +338,16 @@ class StoreProduct extends BaseModel
         }
     }
 
+    /**
+     * 不在当前id中查询
+     * @param $query
+     * @param $value
+     */
+    public function searchIdsAttr($query, $value)
+    {
+        if ($value != '') $query->whereIn('id', $value);
+    }
+
     /**
      * 不在当前id中查询
      * @param $query

+ 7 - 1
crmeb/app/services/product/product/StoreProductServices.php

@@ -93,8 +93,14 @@ class StoreProductServices extends BaseServices
 
     /**
      * 获取列表
-     * @param $where
+     * @param array $where
      * @return array
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     * @author 吴汐
+     * @email 442384644@qq.com
+     * @date 2023/02/17
      */
     public function getList(array $where)
     {