From 426be9d9413d88cf76b760746ab8c5fef9a453ff Mon Sep 17 00:00:00 2001 From: luofei <604446095@qq.com> Date: Tue, 11 Jul 2023 17:58:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A2=E5=8D=95=E6=95=B0?= =?UTF-8?q?=E9=87=8F=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../store/order/StoreOrderRepository.php | 12 ++++++------ .../repositories/store/product/ProductRepository.php | 8 ++++++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index a04596f7..0d2b3899 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -563,14 +563,14 @@ class StoreOrderRepository extends BaseRepository public function userOrderNumber(int $uid, $product_type=0) { $noPay = app()->make(StoreGroupOrderRepository::class)->orderNumber($uid, $product_type); - $noPostage = $this->dao->search(['uid' => $uid, 'status' => 0, 'paid' => 1,'is_user' => 1, 'product_type' => $product_type])->where('StoreOrder.is_del', 0)->count(); - $noDeliver = $this->dao->search(['uid' => $uid, 'status' => 1, 'paid' => 1, 'product_type' => $product_type])->where('StoreOrder.is_del', 0)->count(); - $noComment = $this->dao->search(['uid' => $uid, 'status' => 2, 'paid' => 1,'is_user' => 1, 'product_type' => $product_type])->where('StoreOrder.is_del', 0)->count(); - $done = $this->dao->search(['uid' => $uid, 'status' => 3, 'paid' => 1,'is_user' => 1, 'product_type' => $product_type])->where('StoreOrder.is_del', 0)->count(); + $noPostage = $this->dao->search(['uid' => $uid, 'status' => 0, 'paid' => 1,'is_user' => 1])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count(); + $noDeliver = $this->dao->search(['uid' => $uid, 'status' => 1, 'paid' => 1])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count(); + $noComment = $this->dao->search(['uid' => $uid, 'status' => 2, 'paid' => 1,'is_user' => 1])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count(); + $done = $this->dao->search(['uid' => $uid, 'status' => 3, 'paid' => 1,'is_user' => 1])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count(); $refund = app()->make(StoreRefundOrderRepository::class)->getWhereCount(['uid' => $uid, 'status' => [0, 1, 2]]); //$orderPrice = $this->dao->search(['uid' => $uid, 'paid' => 1])->sum('pay_price'); - $all = $this->dao->search(['uid' => $uid, 'status' => -2,'is_user' => 1, 'product_type' => $product_type])->where('StoreOrder.is_del', 0)->count(); - $orderCount = $this->dao->search(['uid' => $uid, 'paid' => 1,'is_user' => 1, 'product_type' => $product_type])->where('StoreOrder.is_del', 0)->count(); + $all = $this->dao->search(['uid' => $uid, 'status' => -2,'is_user' => 1])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count(); + $orderCount = $this->dao->search(['uid' => $uid, 'paid' => 1,'is_user' => 1])->where('activity_type', $product_type)->where('StoreOrder.is_del', 0)->count(); return compact('noComment', 'done', 'refund', 'noDeliver', 'noPay', 'noPostage', 'orderCount', 'all'); } diff --git a/app/common/repositories/store/product/ProductRepository.php b/app/common/repositories/store/product/ProductRepository.php index 0a8a894c..6c4453d2 100644 --- a/app/common/repositories/store/product/ProductRepository.php +++ b/app/common/repositories/store/product/ProductRepository.php @@ -67,7 +67,7 @@ class ProductRepository extends BaseRepository protected $dao; const CREATE_PARAMS = [ - "image", "slider_image", "store_name", "store_info", "keyword", "bar_code", "guarantee_template_id", "cate_id", "mer_cate_id", "unit_name", "sort" , "is_show", "is_good", 'is_gift_bag', 'integral_rate', "video_link", "temp_id", "content", "spec_type", "extension_type", "attr", 'mer_labels', 'delivery_way', 'delivery_free','param_temp_id','extend', + "image", "slider_image", "store_name", "store_info", "keyword", "bar_code", "guarantee_template_id", "cate_id", "mer_cate_id", "unit_name", "sort" , "is_show", "is_good", 'is_gift_bag', 'integral_rate', "video_link", "temp_id", "content", "spec_type", "extension_type", "attr", 'mer_labels', 'delivery_way', 'delivery_free','param_temp_id','extend', 'source_product_id', ["brand_id",0], ['once_max_count',0], ['once_min_count',0], @@ -483,6 +483,7 @@ class ProductRepository extends BaseRepository 'once_max_count' => $data['once_max_count'] ?? 0, 'pay_limit' => $data['pay_limit'] ?? 0, 'svip_price_type' => $data['svip_price_type'] ?? 0, + 'source_product_id' => $data['source_product_id'] ?? 0, ]; $result['bar_code'] = $data['attrValue'][0]['bar_code'] ?? ''; if (isset($data['mer_id'])) @@ -2374,7 +2375,10 @@ class ProductRepository extends BaseRepository $find['attr'][] = ['attr_name' => $item['attr_name'], 'detail' => explode('-!-', $item['attr_values'])]; } $where = empty($unique) ? ['product_id' => $find['product_id']] : ['product_id' => $find['product_id'], 'unique' => $unique]; - $find['attrValue'] = Db::name('store_product_attr_value')->where($where)->field('image,price,cost,ot_price,svip_price,0 as stock,bar_code,weight,volume,detail')->select(); + $find['attrValue'] = Db::name('store_product_attr_value')->where($where)->field('image,price,cost,ot_price,svip_price,0 as stock,bar_code,weight,volume,detail')->select()->each(function ($item) { + $item['detail'] = empty($item['detail']) ? [] : json_decode($item['detail'], true); + return $item; + })->toArray(); $find['content'] = Db::name('store_product_content')->where('product_id', $find['product_id'])->value('content'); $find['is_show'] = 0; $find['mer_id'] = $mer_id;