From fa18b54944b830b4f7b3eca6485d518aef0637ce Mon Sep 17 00:00:00 2001 From: From-wh Date: Mon, 3 Apr 2023 16:42:30 +0800 Subject: [PATCH 1/3] =?UTF-8?q?improve:=20=E5=AE=A2=E6=9C=8D=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/uni-app/pages/extension/customer_list/chat.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/template/uni-app/pages/extension/customer_list/chat.vue b/template/uni-app/pages/extension/customer_list/chat.vue index 4434f8838..e2552b5df 100644 --- a/template/uni-app/pages/extension/customer_list/chat.vue +++ b/template/uni-app/pages/extension/customer_list/chat.vue @@ -80,7 +80,7 @@ - {{$t(`订单号`)}}: {{ item.orderInfo.order_id }} From 347b0c0b87eb51e79151edb48a74a6f8568e5c49 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Mon, 3 Apr 2023 17:16:31 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/dao/BaseDao.php | 39 +++++-------------- .../dao/product/product/StoreProductDao.php | 5 ++- 2 files changed, 13 insertions(+), 31 deletions(-) diff --git a/crmeb/app/dao/BaseDao.php b/crmeb/app/dao/BaseDao.php index 1c7fce6ba..9ad15edbf 100644 --- a/crmeb/app/dao/BaseDao.php +++ b/crmeb/app/dao/BaseDao.php @@ -47,6 +47,7 @@ abstract class BaseDao * 读取数据条数 * @param array $where * @return int + * @throws \ReflectionException */ public function count(array $where = []) { @@ -59,8 +60,10 @@ abstract class BaseDao * @param string $field * @param int $page * @param int $limit + * @param string $order * @param bool $search * @return \think\Collection + * @throws \ReflectionException * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException @@ -310,7 +313,7 @@ abstract class BaseDao if ($responses->hasMethod($method)) { $with[] = $key; } else { - if (!in_array($key, ['timeKey', 'store_stock','start_status'])) { + if (!in_array($key, ['timeKey', 'store_stock', 'integral_time'])) { $otherWhere[] = is_array($value) ? $value : [$key, '=', $value]; } } @@ -380,6 +383,9 @@ abstract class BaseDao * @param string|null $keyField * @param int $acc * @return bool + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ public function bcInc($key, string $incField, string $inc, string $keyField = null, int $acc = 2) { @@ -394,6 +400,9 @@ abstract class BaseDao * @param string|null $keyField * @param int $acc * @return bool + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException */ public function bcDec($key, string $decField, string $dec, string $keyField = null, int $acc = 2) { @@ -460,18 +469,6 @@ abstract class BaseDao })->dec($stock, $num)->inc($sales, $num)->update(); } return false; -// $field = $isQuota ? [$stock, $sales, 'quota'] : [$stock, $sales]; -// $info = $this->getModel()->where($where)->field($field)->find(); -// if ($info) { -// if ($isQuota) { -// $info->quota = (int)$info->quota - $num; -// } -// $info->stock = (int)$info->stock - $num; -// $info->sales = (int)$info->sales + $num; -// return $info->save(); -// } else { -// return false; -// } } /** @@ -502,22 +499,6 @@ abstract class BaseDao })->inc($stock, $num)->dec($sales, $salesNum)->update(); } return true; -// $field = $isQuota ? [$stock, $sales, 'quota'] : [$stock, $sales]; -// $info = $this->getModel()->where($where)->field($field)->find(); -// if ($info) { -// if ($isQuota) { -// $info->quota = (int)$info->quota + $num; -// } -// $info->stock = (int)$info->stock + $num; -// if ((int)$info->sales > $num) { -// $info->sales = (int)$info->sales - $num; -// } else { -// $info->sales = 0; -// } -// return $info->save(); -// } else { -// return false; -// } } /** diff --git a/crmeb/app/dao/product/product/StoreProductDao.php b/crmeb/app/dao/product/product/StoreProductDao.php index 0048a885d..61eefcc97 100644 --- a/crmeb/app/dao/product/product/StoreProductDao.php +++ b/crmeb/app/dao/product/product/StoreProductDao.php @@ -63,7 +63,9 @@ class StoreProductDao extends BaseDao * @param array $where * @param int $page * @param int $limit + * @param string $order * @return array + * @throws \ReflectionException * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException @@ -71,7 +73,7 @@ class StoreProductDao extends BaseDao public function getList(array $where, int $page = 0, int $limit = 0, string $order = '') { $prefix = Config::get('database.connections.' . Config::get('database.default') . '.prefix'); - return $this->search($where)->order(($order ? $order . ' ,' : '') . 'sort desc,id desc') + return $this->search($where, false)->order(($order ? $order . ' ,' : '') . 'sort desc,id desc') ->when($page != 0 && $limit != 0, function ($query) use ($page, $limit) { $query->page($page, $limit); })->field([ @@ -79,7 +81,6 @@ class StoreProductDao extends BaseDao '(SELECT count(*) FROM `' . $prefix . 'store_product_relation` WHERE `product_id` = `' . $prefix . 'store_product`.`id` AND `type` = \'collect\') as collect', '(SELECT count(*) FROM `' . $prefix . 'store_product_relation` WHERE `product_id` = `' . $prefix . 'store_product`.`id` AND `type` = \'like\') as likes', '(SELECT SUM(stock) FROM `' . $prefix . 'store_product_attr_value` WHERE `product_id` = `' . $prefix . 'store_product`.`id` AND `type` = 0) as stock', -// '(SELECT SUM(sales) FROM `' . $prefix . 'store_product_attr_value` WHERE `product_id` = `' . $prefix . 'store_product`.`id` AND `type` = 0) as sales', '(SELECT count(*) FROM `' . $prefix . 'store_visit` WHERE `product_id` = `' . $prefix . 'store_product`.`id` AND `product_type` = \'product\') as visitor', ])->select()->toArray(); } From 0908c205895b0b973d91910f47d37efa9658c678 Mon Sep 17 00:00:00 2001 From: evoxwht <442384644@qq.com> Date: Mon, 3 Apr 2023 17:58:22 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=AE=A2=E6=9C=8D?= =?UTF-8?q?=E8=81=8A=E5=A4=A9=E8=AE=B0=E5=BD=95=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crmeb/app/services/kefu/service/StoreServiceLogServices.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crmeb/app/services/kefu/service/StoreServiceLogServices.php b/crmeb/app/services/kefu/service/StoreServiceLogServices.php index 527ab9cb4..7bbe381f0 100644 --- a/crmeb/app/services/kefu/service/StoreServiceLogServices.php +++ b/crmeb/app/services/kefu/service/StoreServiceLogServices.php @@ -120,7 +120,7 @@ class StoreServiceLogServices extends BaseServices foreach ($list as &$item) { $item['_add_time'] = $item['add_time']; $item['add_time'] = strtotime($item['_add_time']); - $item['productInfo'] = $item['orderInfo'] = []; + $item['productInfo'] = $item['orderInfo'] = null; if ($item['msn_type'] == self::MSN_TYPE_GOODS && $item['msn']) { $productIds[] = $item['msn']; } elseif ($item['msn_type'] == self::MSN_TYPE_ORDER && $item['msn']) { @@ -155,7 +155,7 @@ class StoreServiceLogServices extends BaseServices foreach ($list as &$item) { if ($item['msn_type'] == self::MSN_TYPE_GOODS && $item['msn']) { - $item['productInfo'] = $productList[$item['msn']] ?? []; + $item['productInfo'] = $productList[$item['msn']] ?? null; } elseif ($item['msn_type'] == self::MSN_TYPE_ORDER && $item['msn']) { $order = $orderInfo[$item['msn']] ?? null; if ($order) { @@ -164,7 +164,7 @@ class StoreServiceLogServices extends BaseServices $order['add_time_h'] = date('H:i:s', $order['add_time']); $item['orderInfo'] = $order; } else { - $item['orderInfo'] = []; + $item['orderInfo'] = null; } } $item['msn_type'] = (int)$item['msn_type'];