From 29772c4fb4fbbd8be4f7305ad745382cf99c2e5c Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Wed, 3 Jul 2024 15:43:02 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E7=94=A8=E6=88=B7=E9=A2=86=E5=8F=96?= =?UTF-8?q?=E7=A4=BC=E5=93=81=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/user/UserController.php | 15 ++++++++ app/admin/logic/user/UserLogic.php | 15 ++++++++ .../store_product_gift/StoreProductGift.php | 34 +++++++++++++++++++ 3 files changed, 64 insertions(+) create mode 100644 app/common/model/store_product_gift/StoreProductGift.php diff --git a/app/admin/controller/user/UserController.php b/app/admin/controller/user/UserController.php index 2f83ae7bf..67c3ed06c 100644 --- a/app/admin/controller/user/UserController.php +++ b/app/admin/controller/user/UserController.php @@ -81,5 +81,20 @@ class UserController extends BaseAdminController return $this->success('ok', $res); } + + //用户领取列表 + public function userGiftList() + { + $uid = (new UserValidate())->goCheck('detail'); + $page_no = (int)$this->request->get('page_no', 1); + $page_size = (int)$this->request->get('page_size', 15); + $params = $this->request->get(); + $params['page_no'] = $page_no > 0 ? $page_no : 1; + $params['page_size'] = $page_size > 0 ? $page_size : 15; + $res = UserLogic::giftList($uid,$params); + $res['page_no'] = $params['page_no']; + $res['page_size'] = $params['page_size']; + return $this->success('ok', $res); + } } \ No newline at end of file diff --git a/app/admin/logic/user/UserLogic.php b/app/admin/logic/user/UserLogic.php index ef37de50b..7f0a9be3f 100644 --- a/app/admin/logic/user/UserLogic.php +++ b/app/admin/logic/user/UserLogic.php @@ -20,6 +20,7 @@ use app\common\logic\BaseLogic; use app\common\model\finance\CapitalFlow; use app\common\model\store_finance_flow\StoreFinanceFlow; use app\common\model\store_order\StoreOrder; +use app\common\model\store_product_gift\StoreProductGift; use app\common\model\user\User; use app\common\model\user\UserAddress; use app\common\model\user\UserRecharge; @@ -279,4 +280,18 @@ class UserLogic extends BaseLogic } + + public static function giftList($uid,$params) + { + $query = StoreProductGift::with(['store','user','goodsName'])->where('uid',$uid); + $count = $query->count(); + $list = $query->page($params['page_no'],$params['page_size']) + ->order('id','desc') + ->select()->toArray(); + return [ + 'lists' => $list, + 'count' => $count + ]; + + } } diff --git a/app/common/model/store_product_gift/StoreProductGift.php b/app/common/model/store_product_gift/StoreProductGift.php new file mode 100644 index 000000000..a4e1c07a1 --- /dev/null +++ b/app/common/model/store_product_gift/StoreProductGift.php @@ -0,0 +1,34 @@ +hasOne(SystemStore::class, 'id', 'store_id') + ->bind(['store_name' => 'name', 'store_phone' => 'phone', 'store_detailed_address' => 'detailed_address', 'store_simple_address' => 'address']); + } + + public function user() + { + return $this->hasOne(User::class, 'id', 'uid')->bind(['nickname', 'avatar', 'mobile']); + } + + public function goodsName() + { + return $this->hasOne(StoreProduct::class,'id','product_id')->bind(['goods_name'=>'store_name','image','unit','price']); + } + +} \ No newline at end of file From 2a9394c1451315a2b6b57d3686380479738c6a20 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Wed, 3 Jul 2024 15:48:24 +0800 Subject: [PATCH 2/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/user/UserController.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/admin/controller/user/UserController.php b/app/admin/controller/user/UserController.php index 67c3ed06c..3beea43fb 100644 --- a/app/admin/controller/user/UserController.php +++ b/app/admin/controller/user/UserController.php @@ -91,6 +91,7 @@ class UserController extends BaseAdminController $params = $this->request->get(); $params['page_no'] = $page_no > 0 ? $page_no : 1; $params['page_size'] = $page_size > 0 ? $page_size : 15; + $uid = $uid['id']; $res = UserLogic::giftList($uid,$params); $res['page_no'] = $params['page_no']; $res['page_size'] = $params['page_size']; From 3b07baf640a98e9e9159390bd29599f30461289a Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Wed, 3 Jul 2024 16:04:20 +0800 Subject: [PATCH 3/6] =?UTF-8?q?=E6=8E=92=E9=99=A4=E9=80=80=E6=AC=BE?= =?UTF-8?q?=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/statistics/logic/OrderLogic.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/statistics/logic/OrderLogic.php b/app/statistics/logic/OrderLogic.php index 274653768..afdfe3bbf 100644 --- a/app/statistics/logic/OrderLogic.php +++ b/app/statistics/logic/OrderLogic.php @@ -69,10 +69,11 @@ class OrderLogic extends BaseLogic public static function dealFlexiblePrice($where,$start,$end) { - $todayAmount = UserRecharge::where($where) + //排除退款 + $todayAmount = UserRecharge::where($where)->where('status',1) ->whereBetweenTime('create_time', $start, $end) ->sum('price'); - $pay_price = StoreOrder::where($where) + $pay_price = StoreOrder::where($where)->where('refund_status',0) ->whereBetweenTime('create_time', $start, $end) ->sum('pay_price'); return bcadd($todayAmount, $pay_price, 2); From 2f1288949bd9073abcafed75d875b5e19a8b7a74 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Wed, 3 Jul 2024 16:27:45 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9D=A1=E5=BD=A2?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/logic/store_product/StoreProductLogic.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/admin/logic/store_product/StoreProductLogic.php b/app/admin/logic/store_product/StoreProductLogic.php index 1220fab27..38ee89a68 100644 --- a/app/admin/logic/store_product/StoreProductLogic.php +++ b/app/admin/logic/store_product/StoreProductLogic.php @@ -210,7 +210,8 @@ class StoreProductLogic extends BaseLogic 'batch'=>$params['batch'],'store_name'=>$params['store_name'], 'manufacturer_information' => $params['manufacturer_information']??'', 'store_info' => $params['store_info']??'','cate_id'=>$params['cate_id'], - 'top_cate_id'=>$dealCate['top_cate_id'],'two_cate_id'=>$dealCate['two_cate_id'] + 'top_cate_id'=>$dealCate['top_cate_id'],'two_cate_id'=>$dealCate['two_cate_id'], + 'bar_code'=> $params['bar_code'] ]); Db::commit(); From b76f630bbd9fd1d0359a0db791b3b7a5aa439898 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Wed, 3 Jul 2024 16:30:45 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=99=90=E5=88=B6?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9C=AA=E9=80=80=E6=AC=BE=E7=9A=84=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/store/logic/WorkbenchLogic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/store/logic/WorkbenchLogic.php b/app/store/logic/WorkbenchLogic.php index 4f3ff7681..87d840c26 100644 --- a/app/store/logic/WorkbenchLogic.php +++ b/app/store/logic/WorkbenchLogic.php @@ -602,7 +602,7 @@ class WorkbenchLogic extends BaseLogic //当日营业额的统计 $today = StoreOrder::where(['paid' => YesNoEnum::YES, 'store_id' => $params['store_id']]); - $turnover_today = $today + $turnover_today = $today->where('refund_status',0) ->whereDay('create_time') ->sum('pay_price'); //当日利润的统计 From 6819cc3b21e8f1a42e5dd1cc5ca95186b7eacf3c Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Wed, 3 Jul 2024 16:33:48 +0800 Subject: [PATCH 6/6] =?UTF-8?q?=E5=8C=BA=E5=88=86=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E5=92=8C=E6=94=B6=E9=93=B6=E5=8F=B0=E6=B6=88=E6=81=AF?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/PayNotifyLogic.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index dec69583f..9cd33524b 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -114,7 +114,9 @@ class PayNotifyLogic extends BaseLogic ]; OrderLogic::writeOff($params); } - PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']); + if(in_array($order['shipping_type'],[1,2])){ + PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']); + } return true; // Redis::send('push-platform-print', ['id' => $order['id']], 60); @@ -242,7 +244,9 @@ class PayNotifyLogic extends BaseLogic // Redis::send('push-platform-print', ['id' => $order['id']], 60); - PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']); + if(in_array($order['shipping_type'],[1,2])){ + PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']); + } } //采购款支付后如果有对应的冻结的话就去反对应的log