From 7366a9e581c51abbd1d3688b0523d593d8296d16 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Tue, 2 Jul 2024 18:55:58 +0800 Subject: [PATCH 01/60] =?UTF-8?q?feat(user):=20=E6=B7=BB=E5=8A=A0=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=88=B9=E5=8F=AA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/logic/user/UserLogic.php | 1 + app/api/lists/user_create_log/UserCreateLogLists.php | 1 + 2 files changed, 2 insertions(+) diff --git a/app/admin/logic/user/UserLogic.php b/app/admin/logic/user/UserLogic.php index d911d34f..cac512f8 100644 --- a/app/admin/logic/user/UserLogic.php +++ b/app/admin/logic/user/UserLogic.php @@ -102,6 +102,7 @@ class UserLogic extends BaseLogic 'create_uid' => $params['create_uid']??0, 'store_id' => $params['store_id']??0, 'staff_id' => $params['staff_id']??0, + 'user_ship' => $data['user_ship']??0, ]); UserAddress::create([ 'uid' => $res['id'], diff --git a/app/api/lists/user_create_log/UserCreateLogLists.php b/app/api/lists/user_create_log/UserCreateLogLists.php index fc9d05a7..aad9deb9 100644 --- a/app/api/lists/user_create_log/UserCreateLogLists.php +++ b/app/api/lists/user_create_log/UserCreateLogLists.php @@ -45,6 +45,7 @@ class UserCreateLogLists extends BaseAdminDataLists implements ListsSearchInterf */ public function lists(): array { + $this->searchWhere['user_ship'] =4; $data = UserCreateLog::where($this->searchWhere) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) From 40a92fbb496bcd29424daf41ae7d4dabadfd6e94 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Wed, 3 Jul 2024 09:31:03 +0800 Subject: [PATCH 02/60] =?UTF-8?q?=E4=BD=99=E9=A2=9D=E5=92=8C=E9=87=87?= =?UTF-8?q?=E8=B4=AD=E6=AC=BE=E6=8E=A8=E9=80=81=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/PayNotifyLogic.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index 889d6a2a..dec69583 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -114,9 +114,10 @@ class PayNotifyLogic extends BaseLogic ]; OrderLogic::writeOff($params); } + 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); - // PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']); + } /** @@ -241,7 +242,7 @@ 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' => '您有一笔新的订单']); + PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']); } //采购款支付后如果有对应的冻结的话就去反对应的log From 15414c2a414b0bd1803e920bc060ed93e94076f3 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Wed, 3 Jul 2024 10:20:58 +0800 Subject: [PATCH 03/60] =?UTF-8?q?=E5=85=BC=E5=AE=B9=E6=94=B6=E9=93=B6?= =?UTF-8?q?=E5=8F=B0=E5=B1=95=E7=A4=BA=E6=94=B6=E6=AC=BE=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/store_order/StoreOrderLogic.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/common/logic/store_order/StoreOrderLogic.php b/app/common/logic/store_order/StoreOrderLogic.php index 1ae87783..88adab80 100644 --- a/app/common/logic/store_order/StoreOrderLogic.php +++ b/app/common/logic/store_order/StoreOrderLogic.php @@ -239,6 +239,9 @@ class StoreOrderLogic extends BaseLogic $order['refund_status_name'] = OrderEnum::refundStatus($order['refund_status']) ?? ''; $order['refund_type_name'] = OrderEnum::refundType($order['refund_type']) ?? ''; $order['pay_type_name'] =PayEnum::getPaySceneDesc($order['pay_type']) ?? ''; + if($order['pay_type'] == PayEnum::PURCHASE_FUNDS && in_array($order['shipping_type'],[1,2])){ + $order['pay_type_name'] = "采购款"; + } if ($order['pay_type'] == 19){ $order['deduction_price'] = "0.00"; } From 89b32e0e6f3768c99a948277b9a6de11fcdbf8f2 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 3 Jul 2024 10:23:18 +0800 Subject: [PATCH 04/60] =?UTF-8?q?feat:=20=E6=9B=B4=E6=96=B0=E5=BA=97?= =?UTF-8?q?=E9=93=BA=E7=8E=B0=E9=87=91=E8=B4=A2=E5=8A=A1=E6=B5=81=E6=B0=B4?= =?UTF-8?q?=E6=8E=A7=E5=88=B6=E5=99=A8=E4=B8=AD=E7=9A=84=E9=93=B6=E8=A1=8C?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StoreCashFinanceFlowController.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/store/controller/store_cash_finance_flow/StoreCashFinanceFlowController.php b/app/store/controller/store_cash_finance_flow/StoreCashFinanceFlowController.php index 28042550..9f859947 100644 --- a/app/store/controller/store_cash_finance_flow/StoreCashFinanceFlowController.php +++ b/app/store/controller/store_cash_finance_flow/StoreCashFinanceFlowController.php @@ -55,10 +55,10 @@ class StoreCashFinanceFlowController extends BaseAdminController { $params = (new StoreCashFinanceFlowValidate())->goCheck('detail'); $result = StoreCashFinanceFlowLogic::detail($params); - $result['image']='https://lihaiim.oss-cn-chengdu.aliyuncs.com/public/uploads/images/20240619/20240619104553f7e108704.jpg'; - $result['bank_code']='456565656'; - $result['bank_name']='里海农科'; - $result['bank_address']='泸州支行'; + $result['image']='https://lihaiim.oss-cn-chengdu.aliyuncs.com/public/uploads/images/20240703/20240703101919cf8429391.jpg'; + $result['bank_code']='22170201040004200'; + $result['bank_name']='泸县供投里海农业科技有限公司'; + $result['bank_address']='中国农业银行股份有限公司泸州石洞支行'; return $this->data($result); } From f23348e8a1fb7f64af294c4e01b6b332afb7ebcb Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Wed, 3 Jul 2024 11:23:17 +0800 Subject: [PATCH 05/60] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A6=96=E6=AC=A1?= =?UTF-8?q?=E4=B8=8B=E5=8D=95=E5=92=8C=E5=90=8E=E7=BB=AD=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E4=B8=8B=E5=8D=95=E6=8B=BF=E6=9C=80=E8=BF=91=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E4=B8=8B=E5=8D=95=E7=9A=84=E5=BA=97=E9=93=BA=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/api/logic/order/OrderLogic.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 9a997a7b..31a6a40f 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -192,8 +192,21 @@ class OrderLogic extends BaseLogic $store['near_store'] = $nearestStore; } }else{ - $store_id = getenv('STORE_ID') ?? 1; - $store['near_store'] =SystemStore::where('id', $store_id)->field('id,name,phone,address,detailed_address,latitude,longitude')->find()??[]; + if(empty($user)){ + $store_id = getenv('STORE_ID') ?? 1; + $store['near_store'] =SystemStore::where('id', $store_id)->field('id,name,phone,address,detailed_address,latitude,longitude')->find()??[]; + }else{ + $checkOrderStore = StoreOrder::where('uid',$user['id'])->field('id,store_id') + ->order('id','desc')->find(); + if($checkOrderStore){ + $store['near_store'] =SystemStore::where('id', $checkOrderStore['store_id'])->field('id,name,phone,address,detailed_address,latitude,longitude')->find()??[]; + }else{ + $store_id = getenv('STORE_ID') ?? 1; + $store['near_store'] =SystemStore::where('id', $store_id)->field('id,name,phone,address,detailed_address,latitude,longitude')->find()??[]; + } + + } + } } catch (\Exception $e) { self::setError($e->getMessage()); From 1639b5430116f0d5c24f92a730c5950b34e87055 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 3 Jul 2024 14:09:12 +0800 Subject: [PATCH 06/60] =?UTF-8?q?feat(UserLogic):=20=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AD=89=E7=BA=A7=E9=99=90=E5=88=B6=E5=8C=BA?= =?UTF-8?q?=E5=9F=9F=E7=AE=A1=E7=90=86=E5=91=98=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/logic/user/UserLogic.php | 18 ++++++++++++++++++ app/api/controller/store/StoreController.php | 8 ++++---- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/app/admin/logic/user/UserLogic.php b/app/admin/logic/user/UserLogic.php index cac512f8..ef37de50 100644 --- a/app/admin/logic/user/UserLogic.php +++ b/app/admin/logic/user/UserLogic.php @@ -77,6 +77,24 @@ class UserLogic extends BaseLogic public static function StoreAdd(array $params) { + $user_ship=$params['user_ship']??0; + if($user_ship==2){ + $arr=User::where('user_ship',$user_ship)->column('id'); + if($arr){ + $find=UserAddress::where('uid','in',$arr)->where('village',$params['village'])->find(); + if($find){ + self::setError('该区域又有村长请重新选择'); + } + } + }elseif($user_ship==3){ + $arr=User::where('user_ship',$user_ship)->column('id'); + if($arr){ + $find=UserAddress::where('uid','in',$arr)->where('brigade',$params['brigade'])->find(); + if($find){ + self::setError('该区域已有对长请重新选择'); + } + } + } $passwordSalt = Config::get('project.unique_identification'); $password = create_password(123456, $passwordSalt); $defaultAvatar = config('project.default_image.admin_avatar'); diff --git a/app/api/controller/store/StoreController.php b/app/api/controller/store/StoreController.php index 61410d88..e7e45fbd 100644 --- a/app/api/controller/store/StoreController.php +++ b/app/api/controller/store/StoreController.php @@ -83,15 +83,15 @@ class StoreController extends BaseApiController $find=User::where('account|mobile',$params['mobile'])->find(); if(!$find){ $params['create_uid']=$this->userId; - $find=UserUserLogic::StoreAdd($params); + UserUserLogic::StoreAdd($params); + if(UserUserLogic::hasError()){ + return $this->fail(UserUserLogic::getError()); + } }else{ $find['real_name']=$params['real_name']; $find['label_id']=$params['label_id']??0; $find->save(); } - if($find === false){ - return $this->fail(UserUserLogic::getError()); - } if($recharge_type!='INDUSTRYMEMBERS'){ return $this->success('添加用户成功'); } From 5ac195ccfbbfa85f92565168b23c8a999456abb5 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 3 Jul 2024 15:13:27 +0800 Subject: [PATCH 07/60] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=9C=B0=E5=9D=80API=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=9C=B0=E5=9D=80=E9=BB=98=E8=AE=A4=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/user/AddressLogic.php | 11 +++++++++-- app/store/controller/user/AddressController.php | 7 ++++--- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/api/logic/user/AddressLogic.php b/app/api/logic/user/AddressLogic.php index a7b8b59f..e7861c3e 100644 --- a/app/api/logic/user/AddressLogic.php +++ b/app/api/logic/user/AddressLogic.php @@ -63,11 +63,11 @@ class AddressLogic extends BaseLogic if($is_default==1){ UserAddress::where('uid',$params['uid'])->update(['is_default'=>0]); } + $find=UserAddress::where('uid', $params['uid'])->where('id', $params['id'])->find(); $data = [ 'real_name' => $params['real_name'], 'phone' => $params['phone'], 'detail' => $params['detail']??'', - 'is_default' => $params['is_default']??0, 'detail' => $params['detail']??'', 'is_default' => $params['is_default']??0, 'province' => $params['province'], @@ -77,7 +77,14 @@ class AddressLogic extends BaseLogic 'village' => $params['village'], 'brigade' => $params['brigade'], ]; - UserAddress::where('uid', $params['uid'])->where('id', $params['id'])->update($data); + if($find){ + UserAddress::where('uid', $params['uid'])->where('id', $params['id'])->update($data); + }else{ + $data['is_default']=1; + $data['uid']=$params['uid']; + UserAddress::create($data); + } + Db::commit(); return true; } catch (\Exception $e) { diff --git a/app/store/controller/user/AddressController.php b/app/store/controller/user/AddressController.php index 5563dc14..e53884d8 100644 --- a/app/store/controller/user/AddressController.php +++ b/app/store/controller/user/AddressController.php @@ -22,10 +22,11 @@ class AddressController extends BaseAdminController public function edit() { $params = (new UserAddressValidate())->post()->goCheck('edit'); - if(AddressLogic::edit($params)){ - return $this->success('编辑成功'); - }else{ + AddressLogic::edit($params); + if(AddressLogic::hasError()){ return $this->fail(AddressLogic::getError()); + }else{ + return $this->success('编辑成功'); } } /** 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 08/60] =?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 2f83ae7b..67c3ed06 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 ef37de50..7f0a9be3 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 00000000..a4e1c07a --- /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 09/60] =?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 67c3ed06..3beea43f 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 10/60] =?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 27465376..afdfe3bb 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 11/60] =?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 1220fab2..38ee89a6 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 12/60] =?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 4f3ff768..87d840c2 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 13/60] =?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 dec69583..9cd33524 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 From c668f34f2927375431e51bec7021f753ae08aeab Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 3 Jul 2024 16:51:32 +0800 Subject: [PATCH 14/60] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E4=BC=9A?= =?UTF-8?q?=E5=91=98=E5=BE=85=E8=BF=94=E5=9B=9E=E9=87=91=E9=A2=9D=E8=AE=A1?= =?UTF-8?q?=E7=AE=97=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/order/OrderLogic.php | 30 ++++++++++++++++------------- app/common/logic/PayNotifyLogic.php | 7 ++----- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 31a6a40f..7372c242 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -99,6 +99,7 @@ class OrderLogic extends BaseLogic $cart_select[$k]['price'] = $price; $cart_select[$k]['cost'] = $find['cost']; $cart_select[$k]['vip'] = 0; + $cart_select[$k]['unit_name'] = StoreProductUnit::where(['id' => $find['unit']])->value('name')??''; //单位名称 //利润 // $cart_select[$k]['profit'] = bcmul($v['cart_num'], $onePrice, 2); //利润 @@ -114,9 +115,17 @@ class OrderLogic extends BaseLogic $cart_select[$k]['old_cart_id'] = $v['id']; $cart_select[$k]['cart_num'] = $v['cart_num']; $cart_select[$k]['verify_code'] = $params['verify_code'] ?? ''; - //vip1待返回金额 - $cart_select[$k]['vip_frozen_price'] = bcsub($cart_select[$k]['pay_price'], $cart_select[$k]['vip_price'], 2); - + $cart_select[$k]['vip_frozen_price']=0; + //会员待返回金额 + if ($user && $off_activity==0){ + if($user['user_ship']==4){ + //商户 + $cart_select[$k]['vip_frozen_price'] = bcsub($cart_select[$k]['pay_price'], $cart_select[$k]['purchase'], 2); + }else{ + //其他会员 + $cart_select[$k]['vip_frozen_price'] = bcsub($cart_select[$k]['pay_price'],$cart_select[$k]['vip_price'], 2); + } + } // d($cart_select[$k]['pay_price'],$cart_select[$k]['store_price'],$cart_select[$k]['vip_price'] ); $cartInfo = $cart_select[$k]; $cartInfo['name'] = $find['store_name']; @@ -136,17 +145,12 @@ class OrderLogic extends BaseLogic // self::$profit = bcadd(self::$profit, $cart_select[$k]['profit'], 2); } //加支付方式限制 - $pay_type = isset($params['pay_type']) ? $params['pay_type'] : 0; - if ($user && $user['user_ship'] == 1 && $pay_type != 17) { - $pay_price = self::$pay_price; - } else { + // $pay_type = isset($params['pay_type']) ? $params['pay_type'] : 0; + // if ($user && $user['user_ship'] == 1 && $pay_type != 17) { + // $pay_price = self::$pay_price; + // } else { $pay_price = bcsub(self::$pay_price, self::$activity_price, 2); //减去活动优惠金额 - } - - // if($pay_price < 500){ - // throw new Exception('金额低于500'); - // } - + // } //成本价 收益 $order = [ 'create_time' => time(), diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index dec69583..36d359a7 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -744,11 +744,8 @@ class PayNotifyLogic extends BaseLogic return false; } - //纯在分销关系的时候要去判断分销出来的用户的采购款的额度 (只有会员按照这个逻辑拆分,其余的还是按照正常的支付金额) - if ($user_ship== 1 && $order['pay_type'] != PayEnum::CASH_PAY) { - $vipFrozenAmount = self::dealFrozenPrice($order['id']); - //为1的时候要去减活动价 - $order['pay_price'] = bcsub($order['pay_price'], $vipFrozenAmount, 2); + //如果是会员需要返回会员金额 + if ($user_ship>0 && $order['pay_type'] != PayEnum::CASH_PAY) { self::dealVipAmount($order, $order['pay_type']); } if ($order['spread_uid'] > 0 || $user_ship > 0) { From ebde5684c0decd063420d7e34fe129aad53ad4ad Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 3 Jul 2024 17:25:57 +0800 Subject: [PATCH 15/60] =?UTF-8?q?feat:=20=E7=A7=BB=E9=99=A4=E4=BA=86UserLo?= =?UTF-8?q?gic=E4=B8=AD=E7=9A=84=E5=86=97=E4=BD=99=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=EF=BC=8C=E5=B9=B6=E5=B0=86=E7=9B=B8=E5=85=B3=E9=80=BB=E8=BE=91?= =?UTF-8?q?=E7=A7=BB=E8=87=B3UserShipLogic=E4=B8=AD=EF=BC=8C=E4=BB=A5?= =?UTF-8?q?=E6=8F=90=E9=AB=98=E4=BB=A3=E7=A0=81=E5=8F=AF=E8=AF=BB=E6=80=A7?= =?UTF-8?q?=E5=92=8C=E5=8F=AF=E7=BB=B4=E6=8A=A4=E6=80=A7=E3=80=82=E5=90=8C?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=A2=9E=E5=8A=A0=E4=BA=86=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E6=9C=89=E6=9D=91=E9=95=BF=E6=88=96=E5=AF=B9?= =?UTF-8?q?=E9=95=BF=E7=9A=84API=E6=8E=A5=E5=8F=A3=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/logic/user/UserLogic.php | 18 ------------ app/admin/logic/user_ship/UserShipLogic.php | 28 +++++++++++++++++++ .../user_ship/UserShipController.php | 11 +++++++- 3 files changed, 38 insertions(+), 19 deletions(-) diff --git a/app/admin/logic/user/UserLogic.php b/app/admin/logic/user/UserLogic.php index 7f0a9be3..43aeec3c 100644 --- a/app/admin/logic/user/UserLogic.php +++ b/app/admin/logic/user/UserLogic.php @@ -78,24 +78,6 @@ class UserLogic extends BaseLogic public static function StoreAdd(array $params) { - $user_ship=$params['user_ship']??0; - if($user_ship==2){ - $arr=User::where('user_ship',$user_ship)->column('id'); - if($arr){ - $find=UserAddress::where('uid','in',$arr)->where('village',$params['village'])->find(); - if($find){ - self::setError('该区域又有村长请重新选择'); - } - } - }elseif($user_ship==3){ - $arr=User::where('user_ship',$user_ship)->column('id'); - if($arr){ - $find=UserAddress::where('uid','in',$arr)->where('brigade',$params['brigade'])->find(); - if($find){ - self::setError('该区域已有对长请重新选择'); - } - } - } $passwordSalt = Config::get('project.unique_identification'); $password = create_password(123456, $passwordSalt); $defaultAvatar = config('project.default_image.admin_avatar'); diff --git a/app/admin/logic/user_ship/UserShipLogic.php b/app/admin/logic/user_ship/UserShipLogic.php index 0166b1a8..9d6880ae 100644 --- a/app/admin/logic/user_ship/UserShipLogic.php +++ b/app/admin/logic/user_ship/UserShipLogic.php @@ -5,6 +5,8 @@ namespace app\admin\logic\user_ship; use app\common\model\user_ship\UserShip; use app\common\logic\BaseLogic; +use app\common\model\user\User; +use app\common\model\user\UserAddress; use think\facade\Db; @@ -95,4 +97,30 @@ class UserShipLogic extends BaseLogic { return UserShip::findOrEmpty($params['id'])->toArray(); } + + /** + * 判断是否有村长或者对长 + * @param $params array 参数数组 + */ + public static function user_ship($params){ + $user_ship=$params['user_ship']??0; + if($user_ship==2){ + $arr=User::where('user_ship',$user_ship)->column('id'); + if($arr){ + $find=UserAddress::where('uid','in',$arr)->where('village',$params['village'])->find(); + if($find){ + self::setError('该区域又有村长请重新选择'); + } + } + }elseif($user_ship==3){ + $arr=User::where('user_ship',$user_ship)->column('id'); + if($arr){ + $find=UserAddress::where('uid','in',$arr)->where('brigade',$params['brigade'])->find(); + if($find){ + self::setError('该区域已有对长请重新选择'); + } + } + } + } + } \ No newline at end of file diff --git a/app/api/controller/user_ship/UserShipController.php b/app/api/controller/user_ship/UserShipController.php index f6b2b9c4..3e6afa1b 100644 --- a/app/api/controller/user_ship/UserShipController.php +++ b/app/api/controller/user_ship/UserShipController.php @@ -2,7 +2,7 @@ namespace app\api\controller\user_ship; - +use app\admin\logic\user_ship\UserShipLogic; use app\api\controller\BaseApiController; use app\common\lists\user\UserShipLists; @@ -28,4 +28,13 @@ class UserShipController extends BaseApiController } + public function is_user_ship(){ + $data=$this->request->post(); + UserShipLogic::user_ship($data); + if(UserShipLogic::hasError()){ + return $this->fail(UserShipLogic::getError()); + }else{ + return $this->success('ok'); + } + } } \ No newline at end of file From 5101dd4e9c319cc10aad425ea0f089536ab3f6d1 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 3 Jul 2024 17:54:12 +0800 Subject: [PATCH 16/60] =?UTF-8?q?feat(UserShipLogic):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=88=B9=E5=8F=AA=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/logic/user_ship/UserShipLogic.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/app/admin/logic/user_ship/UserShipLogic.php b/app/admin/logic/user_ship/UserShipLogic.php index 9d6880ae..ede9266e 100644 --- a/app/admin/logic/user_ship/UserShipLogic.php +++ b/app/admin/logic/user_ship/UserShipLogic.php @@ -105,22 +105,33 @@ class UserShipLogic extends BaseLogic public static function user_ship($params){ $user_ship=$params['user_ship']??0; if($user_ship==2){ + if(!isset($params['village'])){ + self::setError('请设置村参数'); + return false; + } $arr=User::where('user_ship',$user_ship)->column('id'); if($arr){ $find=UserAddress::where('uid','in',$arr)->where('village',$params['village'])->find(); if($find){ self::setError('该区域又有村长请重新选择'); + return false; } } }elseif($user_ship==3){ + if(!isset($params['brigade'])){ + self::setError('请设置队参数'); + return false; + } $arr=User::where('user_ship',$user_ship)->column('id'); if($arr){ - $find=UserAddress::where('uid','in',$arr)->where('brigade',$params['brigade'])->find(); + $find=UserAddress::where('uid','in',$arr)->where('village',$params['village'])->where('brigade',$params['brigade'])->find(); if($find){ - self::setError('该区域已有对长请重新选择'); + self::setError('该区域已有队长请重新选择'); + return false; } } } + return true; } } \ No newline at end of file From 7e2ad42b83ad349a06aafba78906ad1fedf1b482 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 3 Jul 2024 17:58:47 +0800 Subject: [PATCH 17/60] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E4=BA=86Commis?= =?UTF-8?q?sionLogic=E5=92=8CPayNotifyLogic=E7=B1=BB=E4=BB=A5=E5=A4=84?= =?UTF-8?q?=E7=90=86=E4=BC=9A=E5=91=98=E9=87=91=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/CommissionLogic.php | 16 ++++++++++++++++ app/common/logic/PayNotifyLogic.php | 11 ++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/app/common/logic/CommissionLogic.php b/app/common/logic/CommissionLogic.php index f866f4a8..15d8991d 100644 --- a/app/common/logic/CommissionLogic.php +++ b/app/common/logic/CommissionLogic.php @@ -79,6 +79,9 @@ class CommissionLogic extends BaseLogic $financeLogic = new StoreFinanceFlowLogic(); $financeLogic->order = $order; $financeLogic->user['uid'] = $order['uid']; + if(isset($order['dealVipAmount']) &&$order['dealVipAmount']>0){ + $order['pay_price']=bcsub($order['pay_price'],$order['dealVipAmount'],2); + } $fees = bcdiv(bcmul($order['pay_price'], $platformRate, 2), 1, 2); if ($fees > 0) { $financeLogic->in($transaction_id, $fees, OrderEnum::ORDER_HANDLING_FEES, $order['store_id'], $order['staff_id'], 0, $order['pay_type']); //平台手续费 @@ -95,6 +98,9 @@ class CommissionLogic extends BaseLogic $financeLogic = new StoreFinanceFlowLogic(); $financeLogic->order = $order; $financeLogic->user['uid'] = $order['uid']; + if(isset($order['dealVipAmount']) &&$order['dealVipAmount']>0){ + $order['pay_price']=bcsub($order['pay_price'],$order['dealVipAmount'],2); + } $fees = bcsub($order['pay_price'], $platformRate, 2); if ($fees > 0) { $financeLogic->in($transaction_id, $fees, OrderEnum::SUPPLIER_ORDER_OBTAINS, $order['store_id'], $order['staff_id'], 0, $order['pay_type']); @@ -116,6 +122,10 @@ class CommissionLogic extends BaseLogic //缴纳齐全了就加商户没有就加到平台 $money_limt = SystemStore::where('id', $order['store_id'])->field('paid_deposit,security_deposit')->find(); $deposit = bcsub($money_limt['security_deposit'], $money_limt['paid_deposit'], 2); //保证金剩余额度 + + if(isset($order['dealVipAmount']) &&$order['dealVipAmount']>0){ + $order['pay_price']=bcsub($order['pay_price'],$order['dealVipAmount'],2); + } $store_profit = bcmul($order['pay_price'], $platformRate, 2); if ($deposit > 0) { if ($deposit > $store_profit) { @@ -151,6 +161,9 @@ class CommissionLogic extends BaseLogic public static function user($order, $userRate, $transaction_id, $uid = 0, $enum = 0) { $financeLogic = new StoreFinanceFlowLogic(); + if(isset($order['dealVipAmount']) &&$order['dealVipAmount']>0){ + $order['pay_price']=bcsub($order['pay_price'],$order['dealVipAmount'],2); + } $fees = bcmul($order['pay_price'], $userRate, 2); if ($fees > 0) { //记录用户余额收入 @@ -177,6 +190,9 @@ class CommissionLogic extends BaseLogic $financeLogic = new StoreFinanceFlowLogic(); $financeLogic->order = $order; $financeLogic->user['uid'] = $order['uid']; + if(isset($order['dealVipAmount']) &&$order['dealVipAmount']>0){ + $order['pay_price']=bcsub($order['pay_price'],$order['dealVipAmount'],2); + } $fees = bcmul($order['pay_price'], $userRate, 2); if ($fees > 0) { SystemStore::where('id', $order['store_id'])->inc('attrition', $fees)->update(); diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index c6c421af..0461ff54 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -720,6 +720,7 @@ class PayNotifyLogic extends BaseLogic $village_uid = 0; $brigade_uid = 0; $user_ship = 0; + $order['dealVipAmount'] = 0; try { Redis::send('order_wetcha_push_send', ['order' => $order]); } catch (\Exception $e) { @@ -750,7 +751,7 @@ class PayNotifyLogic extends BaseLogic //如果是会员需要返回会员金额 if ($user_ship>0 && $order['pay_type'] != PayEnum::CASH_PAY) { - self::dealVipAmount($order, $order['pay_type']); + $order['dealVipAmount']= self::dealVipAmount($order, $order['pay_type']); } if ($order['spread_uid'] > 0 || $user_ship > 0) { if ($order['spread_uid'] > 0 && $user_ship == 0) { @@ -789,8 +790,12 @@ class PayNotifyLogic extends BaseLogic } } switch ($user_ship) { - case 1: // 行业会员 + case 1: // 厨师 case 4: // 商户 + case 5: // 种养殖 + case 6: // 酒店 + case 7: // 食堂 + case 8: // 一条龙 CommissionLogic::setCook($order, $village_uid, $brigade_uid, $transaction_id); break; case 2: // 村长 @@ -874,7 +879,7 @@ class PayNotifyLogic extends BaseLogic 'create_time' => time() ]; Db::name('vip_flow')->insert($data); - return true; + return $total_vip; } /** From afd09bbb9bdbc83fcd29c9298d8262d389689ef1 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Wed, 3 Jul 2024 18:01:31 +0800 Subject: [PATCH 18/60] =?UTF-8?q?feat(UserShipController):=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0is=5Fuser=5Fship=E6=96=B9=E6=B3=95=E7=94=A8=E4=BA=8E?= =?UTF-8?q?=E5=A4=84=E7=90=86=E7=94=A8=E6=88=B7=E8=88=B9=E5=8F=AA=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/controller/user/UserShipController.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/store/controller/user/UserShipController.php b/app/store/controller/user/UserShipController.php index e6bd8cdc..1ca0bbfe 100644 --- a/app/store/controller/user/UserShipController.php +++ b/app/store/controller/user/UserShipController.php @@ -3,7 +3,7 @@ namespace app\store\controller\user; - +use app\admin\logic\user_ship\UserShipLogic; use app\store\controller\BaseAdminController; use app\common\lists\user\UserShipLists; @@ -15,4 +15,14 @@ class UserShipController extends BaseAdminController { return $this->dataLists(new UserShipLists()); } + + public function is_user_ship(){ + $data=$this->request->post(); + UserShipLogic::user_ship($data); + if(UserShipLogic::hasError()){ + return $this->fail(UserShipLogic::getError()); + }else{ + return $this->success('ok'); + } + } } \ No newline at end of file From 2b364dfa6238e152f769cec443013ae3bd5fe42a Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 4 Jul 2024 09:21:14 +0800 Subject: [PATCH 19/60] =?UTF-8?q?feat(UserLogic):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=88=B9=E5=8F=AA=E5=8F=82=E6=95=B0=E9=AA=8C?= =?UTF-8?q?=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/logic/user/UserLogic.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/app/admin/logic/user/UserLogic.php b/app/admin/logic/user/UserLogic.php index 43aeec3c..e7b04ce3 100644 --- a/app/admin/logic/user/UserLogic.php +++ b/app/admin/logic/user/UserLogic.php @@ -78,6 +78,34 @@ class UserLogic extends BaseLogic public static function StoreAdd(array $params) { + $user_ship=$params['user_ship']??0; + if($user_ship==2){ + if(!isset($params['village'])){ + self::setError('请设置村参数'); + return false; + } + $arr=User::where('user_ship',$user_ship)->column('id'); + if($arr){ + $find=UserAddress::where('uid','in',$arr)->where('village',$params['village'])->find(); + if($find){ + self::setError('该区域又有村长请重新选择'); + return false; + } + } + }elseif($user_ship==3){ + if(!isset($params['brigade'])){ + self::setError('请设置队参数'); + return false; + } + $arr=User::where('user_ship',$user_ship)->column('id'); + if($arr){ + $find=UserAddress::where('uid','in',$arr)->where('village',$params['village'])->where('brigade',$params['brigade'])->find(); + if($find){ + self::setError('该区域已有队长请重新选择'); + return false; + } + } + } $passwordSalt = Config::get('project.unique_identification'); $password = create_password(123456, $passwordSalt); $defaultAvatar = config('project.default_image.admin_avatar'); From f9f39c2ac079411fb6c704c692ad077403028bed Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 4 Jul 2024 09:33:45 +0800 Subject: [PATCH 20/60] =?UTF-8?q?feat(store):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=9C=B0=E5=9D=80=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/store/StoreController.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/api/controller/store/StoreController.php b/app/api/controller/store/StoreController.php index e7e45fbd..4a1cb24f 100644 --- a/app/api/controller/store/StoreController.php +++ b/app/api/controller/store/StoreController.php @@ -14,6 +14,7 @@ use app\common\logic\PaymentLogic; use app\common\logic\PayNotifyLogic; use app\common\model\Config; use app\common\model\user\User; +use app\common\model\user\UserAddress; use app\common\model\user_create_log\UserCreateLog; use app\common\model\user_recharge\UserRecharge; use support\Cache; @@ -91,6 +92,24 @@ class StoreController extends BaseApiController $find['real_name']=$params['real_name']; $find['label_id']=$params['label_id']??0; $find->save(); + $adds=UserAddress::where('uid',$find['id'])->find(); + $adds_data=[ + 'uid' => $find['id'], + 'real_name' => $params['real_name']??"", + 'mobile' => $params['mobile']??'', + 'province' => $params['province']??'', + 'city' => $params['city']??'', + 'area' => $params['area']??'', + 'street' => $params['street']??'', + 'village' => $params['village']??'', + 'brigade' => $params['brigade']??'', + 'is_default' => 1, + ]; + if($adds){ + $adds->save($adds_data); + }else{ + UserAddress::create($adds_data); + } } if($recharge_type!='INDUSTRYMEMBERS'){ return $this->success('添加用户成功'); From f9f0e2e4f8385ee2236e5f82138e6bc1629cf115 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Thu, 4 Jul 2024 10:08:13 +0800 Subject: [PATCH 21/60] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9C=B0=E5=9D=80?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/order/OrderLogic.php | 55 +++++++++++++++--------------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 7372c242..2de85ef7 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -180,37 +180,38 @@ class OrderLogic extends BaseLogic $order['source'] = $params['source']; } //处理返回最近的店铺 - if ((isset($params['lat']) && $params['lat'] != '') && (isset($params['long']) && $params['long'] != '')) { - $storeAll = SystemStore::field('id,name,phone,address,detailed_address,latitude,longitude')->select()->toArray(); - $nearestStore = null; - $minDistance = PHP_FLOAT_MAX; - foreach ($storeAll as $value) { - $value['distance'] = haversineDistance($value['latitude'], $value['longitude'], $params['lat'], $params['long']); - if ($value['distance'] < $minDistance) { - $minDistance = $value['distance']; - $nearestStore = $value; - } - } - $store['near_store'] =[]; - if ($nearestStore) { - $store['near_store'] = $nearestStore; - } + $store_check = 0; + if(empty($user)){ + $store_id = getenv('STORE_ID') ?? 1; + $store['near_store'] =SystemStore::where('id', $store_id)->field('id,name,phone,address,detailed_address,latitude,longitude')->find()??[]; }else{ - if(empty($user)){ + $checkOrderStore = StoreOrder::where('uid',$user['id'])->field('id,store_id') + ->order('id','desc')->find(); + if($checkOrderStore){ + $store['near_store'] =SystemStore::where('id', $checkOrderStore['store_id'])->field('id,name,phone,address,detailed_address,latitude,longitude')->find()??[]; + }else{ $store_id = getenv('STORE_ID') ?? 1; $store['near_store'] =SystemStore::where('id', $store_id)->field('id,name,phone,address,detailed_address,latitude,longitude')->find()??[]; - }else{ - $checkOrderStore = StoreOrder::where('uid',$user['id'])->field('id,store_id') - ->order('id','desc')->find(); - if($checkOrderStore){ - $store['near_store'] =SystemStore::where('id', $checkOrderStore['store_id'])->field('id,name,phone,address,detailed_address,latitude,longitude')->find()??[]; - }else{ - $store_id = getenv('STORE_ID') ?? 1; - $store['near_store'] =SystemStore::where('id', $store_id)->field('id,name,phone,address,detailed_address,latitude,longitude')->find()??[]; - } - } - + $store_check = 1; + } + if ($store_check) { + if ((isset($params['lat']) && $params['lat'] != '') && (isset($params['long']) && $params['long'] != '')) { + $storeAll = SystemStore::field('id,name,phone,address,detailed_address,latitude,longitude')->select()->toArray(); + $nearestStore = null; + $minDistance = PHP_FLOAT_MAX; + foreach ($storeAll as $value) { + $value['distance'] = haversineDistance($value['latitude'], $value['longitude'], $params['lat'], $params['long']); + if ($value['distance'] < $minDistance) { + $minDistance = $value['distance']; + $nearestStore = $value; + } + } + $store['near_store'] =[]; + if ($nearestStore) { + $store['near_store'] = $nearestStore; + } + } } } catch (\Exception $e) { self::setError($e->getMessage()); From c899642f435c22a7df551f93a32ede95d2b8e96a Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 4 Jul 2024 10:10:43 +0800 Subject: [PATCH 22/60] =?UTF-8?q?feat(UserLogic):=20=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E5=8C=BA=E5=9F=9F=E6=9D=91=E9=95=BF=E9=80=89=E6=8B=A9=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/logic/user/UserLogic.php | 2 +- app/store/controller/store_order/StoreOrderController.php | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/admin/logic/user/UserLogic.php b/app/admin/logic/user/UserLogic.php index e7b04ce3..534da83e 100644 --- a/app/admin/logic/user/UserLogic.php +++ b/app/admin/logic/user/UserLogic.php @@ -88,7 +88,7 @@ class UserLogic extends BaseLogic if($arr){ $find=UserAddress::where('uid','in',$arr)->where('village',$params['village'])->find(); if($find){ - self::setError('该区域又有村长请重新选择'); + self::setError('该区域已有村长请重新选择'); return false; } } diff --git a/app/store/controller/store_order/StoreOrderController.php b/app/store/controller/store_order/StoreOrderController.php index 17e1f8c1..c3fdfe54 100644 --- a/app/store/controller/store_order/StoreOrderController.php +++ b/app/store/controller/store_order/StoreOrderController.php @@ -3,6 +3,7 @@ namespace app\store\controller\store_order; use app\admin\logic\user\UserLogic; +use app\admin\logic\user_ship\UserShipLogic; use app\api\logic\order\OrderLogic; use app\api\validate\OrderValidate; use app\common\model\order\Cart; @@ -398,6 +399,10 @@ class StoreOrderController extends BaseAdminController return $this->fail('支付条码不能为空'); } $params = $this->request->post(); + UserShipLogic::user_ship($params); + if(UserShipLogic::hasError()){ + return $this->fail(UserShipLogic::getError()); + } $data = [ 'store_id' => $this->adminInfo['store_id'], 'uid' => $params['uid'], From ad1e4f3f5dfa451a5dfe19b2fbc0b177f7e60a3f Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Thu, 4 Jul 2024 10:15:25 +0800 Subject: [PATCH 23/60] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/order/OrderLogic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 2de85ef7..e7a68185 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -195,7 +195,7 @@ class OrderLogic extends BaseLogic } $store_check = 1; } - if ($store_check) { + if (empty($store_check)) { if ((isset($params['lat']) && $params['lat'] != '') && (isset($params['long']) && $params['long'] != '')) { $storeAll = SystemStore::field('id,name,phone,address,detailed_address,latitude,longitude')->select()->toArray(); $nearestStore = null; From 87161dd9bee6ed3e77e90a66c7ab312bd96b8fff Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 4 Jul 2024 11:32:32 +0800 Subject: [PATCH 24/60] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E6=8E=A7=E5=88=B6=E5=99=A8=E4=BB=A5=E5=A4=84=E7=90=86?= =?UTF-8?q?=E4=B8=8D=E5=90=8C=E7=B1=BB=E5=9E=8B=E7=9A=84=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/PayController.php | 18 ++++++++++++------ app/api/controller/store/StoreController.php | 2 ++ app/common/logic/PaymentLogic.php | 8 ++++++-- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/app/api/controller/PayController.php b/app/api/controller/PayController.php index df0eb102..082f7930 100644 --- a/app/api/controller/PayController.php +++ b/app/api/controller/PayController.php @@ -47,7 +47,7 @@ class PayController extends BaseApiController } else { if ($result && $result->event_type == 'REFUND.SUCCESS') { $ciphertext = $result->resource['ciphertext']; - Cache::set('7logC'.time(),json_encode($ciphertext)); + Cache::set('7logC' . time(), json_encode($ciphertext)); if ($ciphertext['refund_status'] === 'SUCCESS') { //处理订单 -1判断是退的一单还是拆分的订单 $out_trade_no = $ciphertext['out_trade_no'] . '-1'; @@ -68,7 +68,6 @@ class PayController extends BaseApiController public function wechatQuery() { $order_no = $this->request->get('order_no'); - $recharge = $this->request->get('recharge', 0); $order = [ 'out_trade_no' => $order_no, ]; @@ -80,10 +79,17 @@ class PayController extends BaseApiController return $this->fail($e->extra['message']); } if ($res['trade_state'] == 'SUCCESS' && $res['trade_state_desc'] == '支付成功') { - if ($recharge == 0) { - PayNotifyLogic::handle('wechat_common', $res['out_trade_no'], $res); - } else { - PayNotifyLogic::handle('recharge', $res['out_trade_no'], $res); + $attach = $res['attach']; + switch ($attach) { + case 'recharge': + PayNotifyLogic::handle('recharge', $res['out_trade_no'], $res); + $app->wechat->success(); + break; + case 'wechat_common': + default: + PayNotifyLogic::handle('wechat_common', $res['out_trade_no'], $res); + $app->wechat->success(); + break; } return $this->success('支付成功'); } else { diff --git a/app/api/controller/store/StoreController.php b/app/api/controller/store/StoreController.php index 4a1cb24f..de54e5ff 100644 --- a/app/api/controller/store/StoreController.php +++ b/app/api/controller/store/StoreController.php @@ -127,6 +127,7 @@ class StoreController extends BaseApiController $order = UserRecharge::create($data); $order['pay_price']=$order['price']; + $order['attach']=$order['recharge']; $result = PaymentLogic::codepay($auth_code, $order,'条码支付'); if (PaymentLogic::hasError()) { return $this->fail(PaymentLogic::getError()); @@ -155,6 +156,7 @@ class StoreController extends BaseApiController UserRecharge::where('id', $id)->update(['order_id'=>$order_id]); $order['order_id']=$order_id; $order['pay_price']=$order['price']; + $order['attach']=$order['recharge']; $result = PaymentLogic::codepay($auth_code, $order,'条码支付'); if (PaymentLogic::hasError()) { return $this->fail(PaymentLogic::getError()); diff --git a/app/common/logic/PaymentLogic.php b/app/common/logic/PaymentLogic.php index a49df640..322cc442 100644 --- a/app/common/logic/PaymentLogic.php +++ b/app/common/logic/PaymentLogic.php @@ -83,7 +83,7 @@ class PaymentLogic extends BaseLogic self::$error = '请使用正确的微信收付款条码'; return false; } - $order = [ + $data = [ 'description' => $description, 'out_trade_no' => (string)$order['order_id'], 'payer' => [ @@ -97,10 +97,14 @@ class PaymentLogic extends BaseLogic 'id' => (string)$order['store_id']??1 ] ], + 'attach'=>'wechat_common' ]; + if(isset($order['attach']) && $order['attach']!=''){ + $data['attach'] = $order['attach']; + } $wechat = new PayService(1); try { - $result = $wechat->wechat->pos($order)->toArray(); + $result = $wechat->wechat->pos($data)->toArray(); } catch (Exception $e) { Log::error('条码支付报错',['message' => $e->extra['message']?? $e->getMessage(),'code'=>$e->getCode()]); From 42c7cd4f7ef7bf093e1bad0acff18d27bd4dc578 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 4 Jul 2024 13:58:59 +0800 Subject: [PATCH 25/60] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E4=BA=86?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E8=AE=A2=E5=8D=95=E6=94=AF=E4=BB=98=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E7=9A=84API=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/controller/IndexController.php | 27 ++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 app/admin/controller/IndexController.php diff --git a/app/admin/controller/IndexController.php b/app/admin/controller/IndexController.php new file mode 100644 index 00000000..0a45e2c1 --- /dev/null +++ b/app/admin/controller/IndexController.php @@ -0,0 +1,27 @@ +request->get('order_no'); + $order = [ + 'out_trade_no' => $order_no, + ]; + $app = new PayService(0); + + try { + $res = $app->wechat->query($order); + return $this->success('查询成功', $res->toArray()); + } catch (\Exception $e) { + return $this->fail($e->extra['message']); + } + } +} \ No newline at end of file From 4f2617068c4f4da49fd7e73fd19269854b679df6 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Thu, 4 Jul 2024 14:48:39 +0800 Subject: [PATCH 26/60] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=94=99?= =?UTF-8?q?=E8=AF=AF=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/logic/user_ship/UserShipLogic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/admin/logic/user_ship/UserShipLogic.php b/app/admin/logic/user_ship/UserShipLogic.php index ede9266e..89e10eb8 100644 --- a/app/admin/logic/user_ship/UserShipLogic.php +++ b/app/admin/logic/user_ship/UserShipLogic.php @@ -113,7 +113,7 @@ class UserShipLogic extends BaseLogic if($arr){ $find=UserAddress::where('uid','in',$arr)->where('village',$params['village'])->find(); if($find){ - self::setError('该区域又有村长请重新选择'); + self::setError('该区域已有村长请重新选择'); return false; } } From cb8edc5a67519282cebd48ebeba3655b4ceaaab7 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Thu, 4 Jul 2024 17:14:29 +0800 Subject: [PATCH 27/60] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/order/OrderLogic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index e7a68185..2aba676e 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -189,11 +189,11 @@ class OrderLogic extends BaseLogic ->order('id','desc')->find(); if($checkOrderStore){ $store['near_store'] =SystemStore::where('id', $checkOrderStore['store_id'])->field('id,name,phone,address,detailed_address,latitude,longitude')->find()??[]; + $store_check = 1; }else{ $store_id = getenv('STORE_ID') ?? 1; $store['near_store'] =SystemStore::where('id', $store_id)->field('id,name,phone,address,detailed_address,latitude,longitude')->find()??[]; } - $store_check = 1; } if (empty($store_check)) { if ((isset($params['lat']) && $params['lat'] != '') && (isset($params['long']) && $params['long'] != '')) { From 0a96bcd30b72a387333784ce2ea5dd5c71158ba9 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Fri, 5 Jul 2024 10:30:51 +0800 Subject: [PATCH 28/60] =?UTF-8?q?=E9=97=A8=E5=BA=97=E4=BF=9D=E8=AF=81?= =?UTF-8?q?=E9=87=91=E7=BB=9F=E8=AE=A1=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/store/logic/WorkbenchLogic.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/store/logic/WorkbenchLogic.php b/app/store/logic/WorkbenchLogic.php index 87d840c2..de3a9e68 100644 --- a/app/store/logic/WorkbenchLogic.php +++ b/app/store/logic/WorkbenchLogic.php @@ -629,6 +629,7 @@ class WorkbenchLogic extends BaseLogic //总的营业额的统计 总的利润的统计 总的成本合集的统计 总的加到保证金的 $all = StoreOrder::where(['paid' => YesNoEnum::YES, 'store_id' => $params['store_id']]); $deposit_all = StoreFinanceFlow::where(['store_id' => $params['store_id'], 'status' => YesNoEnum::YES]) + ->where('financial_type', OrderEnum::ORDER_MARGIN) ->sum('number'); $cash_all = StoreCashFinanceFlow::where('store_id', $params['store_id']) From 37f0de8c376bb877ea74cb313c7d7cd3d61240f5 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Fri, 5 Jul 2024 11:14:26 +0800 Subject: [PATCH 29/60] =?UTF-8?q?=E5=86=BB=E7=BB=93=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/user/UserLogic.php | 35 +++++++++++++++++++++++++++++ app/common/logic/PayNotifyLogic.php | 1 + 2 files changed, 36 insertions(+) diff --git a/app/api/logic/user/UserLogic.php b/app/api/logic/user/UserLogic.php index 67b4ee75..c1aed62f 100644 --- a/app/api/logic/user/UserLogic.php +++ b/app/api/logic/user/UserLogic.php @@ -330,6 +330,15 @@ class UserLogic extends BaseLogic ->page($params['page_no'],$params['page_size']) ->order('id','desc') ->select()->toArray(); + foreach ($data as &$value){ + if($value['status'] == 0){ + $value['title'] = "购买商品".$value['all']."元获得".$value['number']."元返还金"; + }else{ + //退回到余额、微信、采购款 + $back = self::dealTitleCate($value['pay_type']); + $value['title'] = "返还金解冻".$value['number']."元退回到".$back; + } + } break; default: $data = []; @@ -344,5 +353,31 @@ class UserLogic extends BaseLogic } + public static function dealTitleCate($pay_type) + { + switch ($pay_type){ + case 18: + $title = "采购款"; + break; + case 17: + $title = "现金"; + break; + case 3: + $title ="余额"; + break; + case 7: + case 9: + $title ="微信"; + break; + case 13: + $title ="支付宝"; + break; + default: + $title ="默认"; + } + return $title; + } + + } \ No newline at end of file diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index 0461ff54..c227a730 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -872,6 +872,7 @@ class PayNotifyLogic extends BaseLogic 'order_sn' => $order['order_id'], 'user_id' => $order['uid'], 'number' => $total_vip, + 'all' => $order['pay_price'], 'pay_type' => $pay_type ?? 1, 'status' => 0, 'store_id' => $order['store_id'], From 0dd6f94171e1c49a092bb168bc698feecaae20b6 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 5 Jul 2024 11:31:18 +0800 Subject: [PATCH 30/60] =?UTF-8?q?feat:=20=E6=A0=B9=E6=8D=AE=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E4=BB=B7=E6=A0=BC=E8=B0=83=E6=95=B4=E4=BC=9A=E5=91=98?= =?UTF-8?q?=E7=A7=AF=E5=88=86=E8=AE=A1=E7=AE=97=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/UserSignLogic.php | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/app/common/logic/UserSignLogic.php b/app/common/logic/UserSignLogic.php index fc7e6379..a0a792d9 100644 --- a/app/common/logic/UserSignLogic.php +++ b/app/common/logic/UserSignLogic.php @@ -20,7 +20,26 @@ class UserSignLogic extends BaseLogic */ public static function dealRechargeFrozen($user, $order, $user_ship = 0) { - $total_vip = bcmul($order['price'], 0.1, 2); + switch ($order['price']) { + case ($order['price'] >= 1000 && $order['price'] < 2000): + $total_vip = bcmul($order['price'], 0.25, 2); + break; + case ($order['price'] >= 2000 && $order['price'] < 5000): + $total_vip = bcmul($order['price'], 0.28, 2); + break; + case ($order['price'] >= 5000 && $order['price'] < 10000): + $total_vip = bcmul($order['price'], 0.31, 2); + break; + case ($order['price'] >= 10000): + $total_vip = bcmul($order['price'], 0.35, 2); + break; + default: + $total_vip = 0; + break; + } + if($total_vip==0){ + return false; + } $count = UserSign::where('uid', $order->uid)->count(); if ($count == 0 && in_array($user_ship, [1, 2, 3, 5, 6, 7, 8])) { //首充 From faf5fab258c3849dbd013d9c2154e379177ac9b2 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 5 Jul 2024 11:34:46 +0800 Subject: [PATCH 31/60] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=AD=BE=E5=88=B0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/UserSignLogic.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/common/logic/UserSignLogic.php b/app/common/logic/UserSignLogic.php index a0a792d9..a6cb67f6 100644 --- a/app/common/logic/UserSignLogic.php +++ b/app/common/logic/UserSignLogic.php @@ -21,16 +21,16 @@ class UserSignLogic extends BaseLogic public static function dealRechargeFrozen($user, $order, $user_ship = 0) { switch ($order['price']) { - case ($order['price'] >= 1000 && $order['price'] < 2000): + case $order['price'] >= 1000 && $order['price'] < 2000: $total_vip = bcmul($order['price'], 0.25, 2); break; - case ($order['price'] >= 2000 && $order['price'] < 5000): + case $order['price'] >= 2000 && $order['price'] < 5000: $total_vip = bcmul($order['price'], 0.28, 2); break; - case ($order['price'] >= 5000 && $order['price'] < 10000): + case $order['price'] >= 5000 && $order['price'] < 10000: $total_vip = bcmul($order['price'], 0.31, 2); break; - case ($order['price'] >= 10000): + case $order['price'] >= 10000: $total_vip = bcmul($order['price'], 0.35, 2); break; default: From 380e121726ad59436575e3980ac880dd1f797ff7 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 5 Jul 2024 11:47:41 +0800 Subject: [PATCH 32/60] =?UTF-8?q?feat(UserShipLogic):=20=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E9=80=BB=E8=BE=91=EF=BC=8C=E9=81=BF=E5=85=8D?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E8=AE=BE=E7=BD=AE=E6=9D=91=E9=95=BF=E6=88=96?= =?UTF-8?q?=E9=98=9F=E9=95=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/logic/user_ship/UserShipLogic.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/admin/logic/user_ship/UserShipLogic.php b/app/admin/logic/user_ship/UserShipLogic.php index 89e10eb8..cf804069 100644 --- a/app/admin/logic/user_ship/UserShipLogic.php +++ b/app/admin/logic/user_ship/UserShipLogic.php @@ -113,6 +113,9 @@ class UserShipLogic extends BaseLogic if($arr){ $find=UserAddress::where('uid','in',$arr)->where('village',$params['village'])->find(); if($find){ + if($params['uid']==$find['uid']){ + return true; + } self::setError('该区域已有村长请重新选择'); return false; } @@ -126,6 +129,9 @@ class UserShipLogic extends BaseLogic if($arr){ $find=UserAddress::where('uid','in',$arr)->where('village',$params['village'])->where('brigade',$params['brigade'])->find(); if($find){ + if($params['uid']==$find['uid']){ + return true; + } self::setError('该区域已有队长请重新选择'); return false; } From f9114271ece6000c807c4b4130cd42ad3de40f1a Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 5 Jul 2024 11:52:08 +0800 Subject: [PATCH 33/60] =?UTF-8?q?feat(UserSignLogic):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E7=AD=BE=E5=88=B0=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=94=A8=E6=88=B7=E5=85=85=E5=80=BC=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/UserSignLogic.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/common/logic/UserSignLogic.php b/app/common/logic/UserSignLogic.php index a6cb67f6..24a644dc 100644 --- a/app/common/logic/UserSignLogic.php +++ b/app/common/logic/UserSignLogic.php @@ -5,6 +5,7 @@ namespace app\common\logic; use app\common\logic\BaseLogic; use app\common\model\user\User; +use app\common\model\user_recharge\UserRecharge; use app\common\model\user_sign\UserSign; use app\common\model\user_sign_log\UserSignLog; @@ -40,7 +41,7 @@ class UserSignLogic extends BaseLogic if($total_vip==0){ return false; } - $count = UserSign::where('uid', $order->uid)->count(); + $count = UserRecharge::where('uid', $order->uid)->count(); if ($count == 0 && in_array($user_ship, [1, 2, 3, 5, 6, 7, 8])) { //首充 $write = self::write($order, $total_vip, 0, 1, 9); From 1409782ff7be6b6939b15d721fdbbdf768cb7233 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Fri, 5 Jul 2024 14:17:48 +0800 Subject: [PATCH 34/60] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E5=87=8F=E5=8E=BB=E7=9A=84=E9=97=A8=E5=BA=97=E4=BB=B7=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/order/OrderLogic.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 2aba676e..aeec1b14 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -74,7 +74,7 @@ class OrderLogic extends BaseLogic self::$cost = 0; //成本由采购价替代原成本为门店零售价 self::$profit = 0; //利润 self::$activity_price = 0; //活动减少 - self::$store_price = 0; //门店零售价 + self::$store_price = 0; //商户价 self::$deduction_price =0; $deduction_price = 0; //抵扣金额 /** 计算价格 */ @@ -105,7 +105,7 @@ class OrderLogic extends BaseLogic // $cart_select[$k]['profit'] = bcmul($v['cart_num'], $onePrice, 2); //利润 $cart_select[$k]['purchase'] = bcmul($v['cart_num'], $find['purchase'], 2) ?? 0; //成本 $cart_select[$k]['pay_price'] = bcmul($v['cart_num'], $price, 2); //订单支付金额 - $cart_select[$k]['store_price'] = bcmul($v['cart_num'], $find['cost'], 2) ?? 0; //门店零售价 + $cart_select[$k]['store_price'] = bcmul($v['cart_num'], $find['cost'], 2) ?? 0; //商户价 $cart_select[$k]['vip_price'] = bcmul($v['cart_num'], $find['vip_price'], 2) ?? 0; //vip售价 if($cart_select[$k]['total_price']>$cart_select[$k]['pay_price']){ $deduction_price=bcsub($cart_select[$k]['total_price'],$cart_select[$k]['pay_price'],2); @@ -120,7 +120,7 @@ class OrderLogic extends BaseLogic if ($user && $off_activity==0){ if($user['user_ship']==4){ //商户 - $cart_select[$k]['vip_frozen_price'] = bcsub($cart_select[$k]['pay_price'], $cart_select[$k]['purchase'], 2); + $cart_select[$k]['vip_frozen_price'] = bcsub($cart_select[$k]['pay_price'], $cart_select[$k]['store_price'], 2); }else{ //其他会员 $cart_select[$k]['vip_frozen_price'] = bcsub($cart_select[$k]['pay_price'],$cart_select[$k]['vip_price'], 2); @@ -140,7 +140,7 @@ class OrderLogic extends BaseLogic self::$total_price = bcadd(self::$total_price, $cart_select[$k]['total_price'], 2); self::$pay_price = bcadd(self::$pay_price, $cart_select[$k]['pay_price'], 2); self::$cost = bcadd(self::$cost, $cart_select[$k]['purchase'], 2); - self::$store_price = bcadd(self::$store_price, $cart_select[$k]['store_price'], 2); //门店零售价格 + self::$store_price = bcadd(self::$store_price, $cart_select[$k]['store_price'], 2); //商户价 self::$deduction_price=bcadd(self::$deduction_price,$deduction_price,2);//抵扣金额 // self::$profit = bcadd(self::$profit, $cart_select[$k]['profit'], 2); } From e67e8be75f00406f1ae4268f8cc667f8c664d818 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Fri, 5 Jul 2024 14:30:41 +0800 Subject: [PATCH 35/60] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=86=E6=B6=A6?= =?UTF-8?q?=E9=87=91=E9=A2=9D=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/CommissionLogic.php | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/app/common/logic/CommissionLogic.php b/app/common/logic/CommissionLogic.php index 15d8991d..3cb73f88 100644 --- a/app/common/logic/CommissionLogic.php +++ b/app/common/logic/CommissionLogic.php @@ -49,11 +49,9 @@ class CommissionLogic extends BaseLogic $user_1 = self::user($order, 0.07, $transaction_id, $order['spread_uid'], 12); //会员、厨师 $user_2 = self::user($order, 0.01, $transaction_id, $village_uid, 14); //村长 $user_3 = self::user($order, 0.01, $transaction_id, $brigade_uid, 15); //队长 - $platform = self::platform($order, 0.02, $transaction_id); //平台 $store = self::store($order, 0.05, $transaction_id, 0); //门店 $attrition = self::attrition($order, 0.02,$transaction_id,16); //损耗 - $moeny = bcadd(bcadd(bcadd(bcadd($user_1, $user_2, 2), $user_3, 2), $platform, 2), bcadd($store, $attrition, 2), 2); self::suppliter($order, $moeny, $transaction_id); } @@ -79,10 +77,11 @@ class CommissionLogic extends BaseLogic $financeLogic = new StoreFinanceFlowLogic(); $financeLogic->order = $order; $financeLogic->user['uid'] = $order['uid']; + $pay_price = $order['pay_price']; if(isset($order['dealVipAmount']) &&$order['dealVipAmount']>0){ - $order['pay_price']=bcsub($order['pay_price'],$order['dealVipAmount'],2); + $pay_price=bcsub($order['pay_price'],$order['dealVipAmount'],2); } - $fees = bcdiv(bcmul($order['pay_price'], $platformRate, 2), 1, 2); + $fees = bcdiv(bcmul($pay_price, $platformRate, 2), 1, 2); if ($fees > 0) { $financeLogic->in($transaction_id, $fees, OrderEnum::ORDER_HANDLING_FEES, $order['store_id'], $order['staff_id'], 0, $order['pay_type']); //平台手续费 $financeLogic->out($transaction_id, $fees, OrderEnum::ORDER_HANDLING_FEES, $order['store_id'], $order['staff_id'], 0, $order['pay_type']); //商户平台手续费支出 @@ -98,10 +97,11 @@ class CommissionLogic extends BaseLogic $financeLogic = new StoreFinanceFlowLogic(); $financeLogic->order = $order; $financeLogic->user['uid'] = $order['uid']; + $pay_price = $order['pay_price']; if(isset($order['dealVipAmount']) &&$order['dealVipAmount']>0){ - $order['pay_price']=bcsub($order['pay_price'],$order['dealVipAmount'],2); + $pay_price=bcsub($order['pay_price'],$order['dealVipAmount'],2); } - $fees = bcsub($order['pay_price'], $platformRate, 2); + $fees = bcsub($pay_price, $platformRate, 2); if ($fees > 0) { $financeLogic->in($transaction_id, $fees, OrderEnum::SUPPLIER_ORDER_OBTAINS, $order['store_id'], $order['staff_id'], 0, $order['pay_type']); $financeLogic->out($transaction_id, $fees, OrderEnum::SUPPLIER_ORDER_OBTAINS, $order['store_id'], $order['staff_id'], 0, $order['pay_type']); @@ -122,11 +122,11 @@ class CommissionLogic extends BaseLogic //缴纳齐全了就加商户没有就加到平台 $money_limt = SystemStore::where('id', $order['store_id'])->field('paid_deposit,security_deposit')->find(); $deposit = bcsub($money_limt['security_deposit'], $money_limt['paid_deposit'], 2); //保证金剩余额度 - + $pay_price = $order['pay_price']; if(isset($order['dealVipAmount']) &&$order['dealVipAmount']>0){ - $order['pay_price']=bcsub($order['pay_price'],$order['dealVipAmount'],2); + $pay_price=bcsub($order['pay_price'],$order['dealVipAmount'],2); } - $store_profit = bcmul($order['pay_price'], $platformRate, 2); + $store_profit = bcmul($pay_price, $platformRate, 2); if ($deposit > 0) { if ($deposit > $store_profit) { if ($store_profit > 0) { @@ -161,10 +161,11 @@ class CommissionLogic extends BaseLogic public static function user($order, $userRate, $transaction_id, $uid = 0, $enum = 0) { $financeLogic = new StoreFinanceFlowLogic(); + $pay_price = $order['pay_price']; if(isset($order['dealVipAmount']) &&$order['dealVipAmount']>0){ - $order['pay_price']=bcsub($order['pay_price'],$order['dealVipAmount'],2); + $pay_price=bcsub($order['pay_price'],$order['dealVipAmount'],2); } - $fees = bcmul($order['pay_price'], $userRate, 2); + $fees = bcmul($pay_price, $userRate, 2); if ($fees > 0) { //记录用户余额收入 if ($uid) { @@ -190,10 +191,11 @@ class CommissionLogic extends BaseLogic $financeLogic = new StoreFinanceFlowLogic(); $financeLogic->order = $order; $financeLogic->user['uid'] = $order['uid']; + $pay_price = $order['pay_price']; if(isset($order['dealVipAmount']) &&$order['dealVipAmount']>0){ - $order['pay_price']=bcsub($order['pay_price'],$order['dealVipAmount'],2); + $pay_price=bcsub($order['pay_price'],$order['dealVipAmount'],2); } - $fees = bcmul($order['pay_price'], $userRate, 2); + $fees = bcmul($pay_price, $userRate, 2); if ($fees > 0) { SystemStore::where('id', $order['store_id'])->inc('attrition', $fees)->update(); $financeLogic->in($transaction_id, $fees, $enum, $order['store_id'], $order['staff_id'], 0, $order['pay_type']); From 9082a73f806c570ad3322e53f4049474f588a423 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 5 Jul 2024 14:38:32 +0800 Subject: [PATCH 36/60] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E6=8E=A7=E5=88=B6=E5=99=A8=E5=8F=8A=E9=80=BB=E8=BE=91?= =?UTF-8?q?=EF=BC=8C=E4=BC=98=E5=8C=96=E6=94=AF=E4=BB=98=E6=88=90=E5=8A=9F?= =?UTF-8?q?=E5=90=8E=E7=9A=84=E5=A4=84=E7=90=86=E6=B5=81=E7=A8=8B=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E8=B0=83=E6=95=B4=E4=BC=9A=E5=91=98=E5=85=85=E5=80=BC?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=E6=96=B9=E5=BC=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/PayController.php | 10 ++++++++-- app/common/logic/UserSignLogic.php | 16 ++++++++-------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/app/api/controller/PayController.php b/app/api/controller/PayController.php index 082f7930..b73ff350 100644 --- a/app/api/controller/PayController.php +++ b/app/api/controller/PayController.php @@ -38,10 +38,13 @@ class PayController extends BaseApiController $app->wechat->success(); break; case 'wechat_common': - default: PayNotifyLogic::handle('wechat_common', $ciphertext['out_trade_no'], $ciphertext); $app->wechat->success(); break; + default: + PayNotifyLogic::handle('wechat_common', $res['out_trade_no'], $res); + $app->wechat->success(); + break; } } } else { @@ -76,7 +79,7 @@ class PayController extends BaseApiController try { $res = $app->wechat->query($order); } catch (\Exception $e) { - return $this->fail($e->extra['message']); + return $this->fail($e->extra['message'] ?? $e->getMessage()); } if ($res['trade_state'] == 'SUCCESS' && $res['trade_state_desc'] == '支付成功') { $attach = $res['attach']; @@ -86,6 +89,9 @@ class PayController extends BaseApiController $app->wechat->success(); break; case 'wechat_common': + PayNotifyLogic::handle('wechat_common', $res['out_trade_no'], $res); + $app->wechat->success(); + break; default: PayNotifyLogic::handle('wechat_common', $res['out_trade_no'], $res); $app->wechat->success(); diff --git a/app/common/logic/UserSignLogic.php b/app/common/logic/UserSignLogic.php index 24a644dc..bbea6d23 100644 --- a/app/common/logic/UserSignLogic.php +++ b/app/common/logic/UserSignLogic.php @@ -22,17 +22,17 @@ class UserSignLogic extends BaseLogic public static function dealRechargeFrozen($user, $order, $user_ship = 0) { switch ($order['price']) { - case $order['price'] >= 1000 && $order['price'] < 2000: - $total_vip = bcmul($order['price'], 0.25, 2); + case 1000: + $total_vip = 249; break; - case $order['price'] >= 2000 && $order['price'] < 5000: - $total_vip = bcmul($order['price'], 0.28, 2); + case 2000: + $total_vip = 560; break; - case $order['price'] >= 5000 && $order['price'] < 10000: - $total_vip = bcmul($order['price'], 0.31, 2); + case 5000: + $total_vip = 1550; break; - case $order['price'] >= 10000: - $total_vip = bcmul($order['price'], 0.35, 2); + case 10000: + $total_vip = 3500; break; default: $total_vip = 0; From 406fa2831bf815af2595c954c2c1eb44ccf919ef Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Fri, 5 Jul 2024 15:28:57 +0800 Subject: [PATCH 37/60] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=8F=96=E6=B6=88?= =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E4=BB=B7=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/lists/product/ProductLists.php | 16 ++++++++-------- app/api/logic/order/OrderLogic.php | 8 ++++---- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/app/api/lists/product/ProductLists.php b/app/api/lists/product/ProductLists.php index 422e9620..81be9bb8 100644 --- a/app/api/lists/product/ProductLists.php +++ b/app/api/lists/product/ProductLists.php @@ -117,19 +117,19 @@ class ProductLists extends BaseAdminDataLists implements ListsSearchInterface, L public function extend() { $off_activity = Config::where('name', 'off_activity')->value('value'); - if($off_activity==1){ - $data=[ - 'off_activity' => $off_activity, - 'price' => 'cost', - 'op_price' => 'price', - ]; - }else{ +// if($off_activity==1){ +// $data=[ +// 'off_activity' => $off_activity, +// 'price' => 'cost', +// 'op_price' => 'price', +// ]; +// }else{ $data=[ 'off_activity' => $off_activity, 'price' => 'price', 'op_price' => 'price', ]; - } +// } return $data; } } diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index aeec1b14..9f11d63f 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -91,11 +91,11 @@ class OrderLogic extends BaseLogic } unset($cart_select[$k]['id']); $cart_select[$k]['total_price'] = bcmul($v['cart_num'], $find['price'], 2); //订单总价 - if ($off_activity == 1) { - $price = $find['cost']; - } else { +// if ($off_activity == 1) { +// $price = $find['cost']; +// } else { $price = $find['price']; - } +// } $cart_select[$k]['price'] = $price; $cart_select[$k]['cost'] = $find['cost']; $cart_select[$k]['vip'] = 0; From ec8841d67e602f389de21e44f2acff2053fdd84f Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Fri, 5 Jul 2024 15:49:31 +0800 Subject: [PATCH 38/60] =?UTF-8?q?=E5=85=85=E5=80=BC=E9=87=87=E8=B4=AD?= =?UTF-8?q?=E6=AC=BE=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/UserRechargeController.php | 37 ++++++++++++++++++- app/store/controller/user/UserController.php | 35 ++++++++++++++++++ 2 files changed, 71 insertions(+), 1 deletion(-) diff --git a/app/api/controller/user/UserRechargeController.php b/app/api/controller/user/UserRechargeController.php index ba97d6a5..95ebf071 100644 --- a/app/api/controller/user/UserRechargeController.php +++ b/app/api/controller/user/UserRechargeController.php @@ -10,7 +10,6 @@ use app\api\lists\user\UserRechargeLists; class UserRechargeController extends BaseApiController { - /** * @notes 获取用户充值 * @return \support\Response @@ -21,4 +20,40 @@ use app\api\lists\user\UserRechargeLists; { return $this->dataLists(new UserRechargeLists()); } + + public function recharge_list() + { + $buy_bar = "元采购包"; + $send_bar = "品牌礼品券"; + $arr = [ + [ + 'money'=>1000,//采购包 + 'send'=>249,//礼品券 + 'money_string'=>$buy_bar, + 'send_string'=>$send_bar, + ], + [ + 'money'=>2000,//采购包 + 'send'=>560,//礼品券 + 'money_string'=>$buy_bar, + 'send_string'=>$send_bar, + ], + [ + 'money'=>5000,//采购包 + 'send'=>1550,//礼品券 + 'money_string'=>$buy_bar, + 'send_string'=>$send_bar, + ], + [ + 'money'=>10000,//采购包 + 'send'=>3500,//礼品券 + 'money_string'=>$buy_bar, + 'send_string'=>$send_bar, + ] + ]; + return $this->success('ok',$arr); + + + } + } diff --git a/app/store/controller/user/UserController.php b/app/store/controller/user/UserController.php index 47e6b865..8ebd04a3 100644 --- a/app/store/controller/user/UserController.php +++ b/app/store/controller/user/UserController.php @@ -83,4 +83,39 @@ class UserController extends BaseAdminController return $this->success('设置成功'); } + public function recharge_list() + { + $buy_bar = "元采购包"; + $send_bar = "品牌礼品券"; + $arr = [ + [ + 'money'=>1000,//采购包 + 'send'=>249,//礼品券 + 'money_string'=>$buy_bar, + 'send_string'=>$send_bar, + ], + [ + 'money'=>2000,//采购包 + 'send'=>560,//礼品券 + 'money_string'=>$buy_bar, + 'send_string'=>$send_bar, + ], + [ + 'money'=>5000,//采购包 + 'send'=>1550,//礼品券 + 'money_string'=>$buy_bar, + 'send_string'=>$send_bar, + ], + [ + 'money'=>10000,//采购包 + 'send'=>3500,//礼品券 + 'money_string'=>$buy_bar, + 'send_string'=>$send_bar, + ] + ]; + return $this->success('ok',$arr); + + + } + } \ No newline at end of file From 99f22f97a26c5da7a7756f86ef7cb55f23cc659f Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Fri, 5 Jul 2024 16:32:03 +0800 Subject: [PATCH 39/60] =?UTF-8?q?=E8=B0=83=E8=AF=95=E9=87=91=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/user/UserRechargeController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/controller/user/UserRechargeController.php b/app/api/controller/user/UserRechargeController.php index 95ebf071..b7dfbfee 100644 --- a/app/api/controller/user/UserRechargeController.php +++ b/app/api/controller/user/UserRechargeController.php @@ -27,7 +27,7 @@ use app\api\lists\user\UserRechargeLists; $send_bar = "品牌礼品券"; $arr = [ [ - 'money'=>1000,//采购包 + 'money'=>0.01,//采购包 'send'=>249,//礼品券 'money_string'=>$buy_bar, 'send_string'=>$send_bar, From eb3907482280bd5489deddd6dd158851cb0a17fe Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 5 Jul 2024 16:45:54 +0800 Subject: [PATCH 40/60] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E9=80=9A=E7=9F=A5=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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index c227a730..9db8ca26 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -735,7 +735,7 @@ class PayNotifyLogic extends BaseLogic } //积分写入 - if(in_array($user_ship,[0,4])){ + if($order['pay_type']>=14){ UserSignLogic::OrderWrite($order); } if ($off_activity == 1) { From b430a6242e559c6dd93b5adf7d5308e42126ae8a Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 5 Jul 2024 16:46:22 +0800 Subject: [PATCH 41/60] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E7=B1=BB=E5=9E=8B=E5=88=A4=E6=96=AD=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/PayNotifyLogic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index 9db8ca26..d2c67b43 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -735,7 +735,7 @@ class PayNotifyLogic extends BaseLogic } //积分写入 - if($order['pay_type']>=14){ + if($order['pay_type']<=14){ UserSignLogic::OrderWrite($order); } if ($off_activity == 1) { From 97c2b775d72dd66a202da5e6abd0d8f29a18b48c Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Fri, 5 Jul 2024 16:55:25 +0800 Subject: [PATCH 42/60] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9B=9E=E8=B0=83?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/PayController.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/api/controller/PayController.php b/app/api/controller/PayController.php index b73ff350..a3da0e65 100644 --- a/app/api/controller/PayController.php +++ b/app/api/controller/PayController.php @@ -38,11 +38,8 @@ class PayController extends BaseApiController $app->wechat->success(); break; case 'wechat_common': - PayNotifyLogic::handle('wechat_common', $ciphertext['out_trade_no'], $ciphertext); - $app->wechat->success(); - break; default: - PayNotifyLogic::handle('wechat_common', $res['out_trade_no'], $res); + PayNotifyLogic::handle('wechat_common', $ciphertext['out_trade_no'], $ciphertext); $app->wechat->success(); break; } From c122bcb3861a22dcebfdbc01505f76a4d82a11d4 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 5 Jul 2024 16:55:26 +0800 Subject: [PATCH 43/60] =?UTF-8?q?feat(PayNotifyLogic):=20=E9=87=8D?= =?UTF-8?q?=E6=9E=84=E6=94=B6=E9=93=B6=E5=8F=B0=E4=B8=8B=E5=8D=95=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E5=88=B0=E8=B4=A6=E9=80=BB=E8=BE=91=E5=B9=B6=E7=A7=BB?= =?UTF-8?q?=E9=99=A4=E5=86=97=E4=BD=99=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/PayNotifyLogic.php | 154 +--------------------------- 1 file changed, 1 insertion(+), 153 deletions(-) diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index d2c67b43..4dac5898 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -228,164 +228,12 @@ class PayNotifyLogic extends BaseLogic self::dealGoodsLeft($checkArr, $order['uid'], $order['id']); } - // $count = UserSign::where([ - // 'uid'=>$order['uid'], - // 'type'=>1, - // 'status'=>0 - // ])->count(); - // - // if($count){ - // self::addFlowLog($order); - // } - //收银台下单直接到账 - // if($order['shipping_type'] == 3){ - // self::descStock($order['id']); - // } - - // Redis::send('push-platform-print', ['id' => $order['id']], 60); if(in_array($order['shipping_type'],[1,2])){ PushService::push('store_merchant_' . $order['store_id'], $order['store_id'], ['type' => 'store_merchant', 'msg' => '您有一笔新的订单']); } } - //采购款支付后如果有对应的冻结的话就去反对应的log - public static function addFlowLog($order) - { - //查询当前用户有无对应的充值的冻结金额 - if ($order['uid'] > 0) { - $query = UserSign::where([ - 'uid' => $order['uid'], - 'type' => 1, - 'status' => 0 - ]); - // $query1 = clone $query; - // $ids = $query->column('id'); - $check = $query->sum('number'); - // $count = $query1->count(); - if ($check && $check > 0) { - $backPurchase = bcmul($order['pay_price'], 0.1, 2); - - // if($count == 1){ - //存在拆单子否 - //少了就冻结减去这个对应的金额 - $one = UserSign::where([ - 'uid' => $order['uid'], - 'type' => 1, - 'status' => 0 - ])->find(); - $data = [ - 'sid' => $one['id'], - 'uid' => $order['uid'], - 'order_id' => $order['order_id'], - 'title' => '充值获得冻结兑换券', - 'financial_pm' => 1, - 'type' => 1, - 'status' => 1, - ]; - - if ($one['number'] >= $backPurchase) { - // $wait = bcsub($one['number'],$backPurchase,2)??0; - $data['number'] = $backPurchase; - - Db::name('user_sign_log')->insert($data); - - //总的减去采购款百分之十剩余的 - // if(empty($wait)){ - // UserSign::where('id',$one['id'])->update( - // [ - // 'number'=>0, - // 'status'=>1 - // ] - // ); - // }else{ - // //add - // UserSign::where('id',$one['id'])->update( - // [ - // 'number'=>$wait - // ] - // ); - // } - - //并且加到对应的用户的采购款中 - // User::where('id',$order['uid'])->inc('purchase_funds',$wait)->update(); - } else { - //对比采购款支付的多少 多了就拿冻结金额即可 - $data['number'] = $one['number']; - //都存到对应的log日志 - Db::name('user_sign_log')->insert($data); - // UserSign::where('id',$one['id'])->update( - // [ - // 'number'=>0, - // 'status'=>1 - // ] - // ); - //并且加到对应的用户的采购款中 - // User::where('id',$order['uid'])->inc('purchase_funds',$wait)->update(); - } - } - /* else{ - //大于0的时候 - //先处理金额大的再处理剩余的 - //把所有的金额改为正的再加一条后再加 - UserSign::where([ - 'uid'=>$order['uid'], - 'type'=>1, - 'status'=>0 - ])->update([ - 'status'=>1, - 'title'=>json_encode($ids) - ]); - if ($check >= $backPurchase) { - //补一条待解冻的 - $left = bcsub($check,$backPurchase,2); - if($left > 0){ - $data = [ - 'uid' => $order['uid'], - 'order_id' => $order['order_id'], - 'title' => '补冻结兑换券', - 'financial_pm' => 0, - 'type' => 1, - ]; - $data['number'] =$check; - $sid = Db::name('user_sign')->insertGetId($data); - - $data = [ - 'uid' => $order['uid'], - 'sid' => $sid, - 'order_id' => $order['order_id'], - 'title' => '充值获得冻结兑换券', - 'financial_pm' => 1, - 'type' => 1, - ]; - $data['number'] =$backPurchase; - Db::name('user_sign_log')->insert($data); - } -// User::where('id',$order['uid'])->inc('purchase_funds',$backPurchase)->update();//add - - }else{ - //log - $data = [ - 'uid' => $order['uid'], - 'order_id' => $order['order_id'], - 'title' => '充值获得冻结兑换券', - 'financial_pm' => 1, - 'type' => 1, - ]; - $data['number'] =$check; - Db::name('user_sign_log')->insert($data); -// User::where('id',$order['uid'])->inc('purchase_funds',$check)->update();//add - } - - }*/ - - // } - return true; - } - - return true; - } - /** * @notes 微信通用回调 * @param $orderSn @@ -735,7 +583,7 @@ class PayNotifyLogic extends BaseLogic } //积分写入 - if($order['pay_type']<=14){ + if(in_array($order['pay_type'],[3,7,9,13,17])&&$order['uid']>0){ UserSignLogic::OrderWrite($order); } if ($off_activity == 1) { From 95ba546859092b171201f88f61965bfd236cb97b Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 5 Jul 2024 17:09:16 +0800 Subject: [PATCH 44/60] =?UTF-8?q?feat:=20=E7=A7=BB=E9=99=A4=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=88=B9=E5=8F=AA=E9=AA=8C=E8=AF=81=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/order/OrderLogic.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/app/api/logic/order/OrderLogic.php b/app/api/logic/order/OrderLogic.php index 9f11d63f..582db789 100644 --- a/app/api/logic/order/OrderLogic.php +++ b/app/api/logic/order/OrderLogic.php @@ -552,11 +552,7 @@ class OrderLogic extends BaseLogic $money = $financeFlow->where(['order_id' => $order['id'], 'financial_pm' => 1, 'financial_type' => 2])->value('number') ?? 0; $financeFlowLogic->updateStatusStore($order['id'], $order['store_id'], $money, $deposit); //积分结算 - $user_ship=-1; - if($order['uid']){ - $user_ship=User::where('id',$order['uid'])->value('user_ship'); - } - if($order['is_storage']==0&&$order['source']==0&&in_array($user_ship,[0,4])){ + if($order['is_storage']==0&&$order['source']==0){ UserSignLogic::WriteOff($order); } Db::commit(); From 528995259732881b1be215877464b883e1e0aae6 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Fri, 5 Jul 2024 17:22:37 +0800 Subject: [PATCH 45/60] =?UTF-8?q?=E5=AF=B9=E5=BA=94=E5=85=85=E5=80=BC?= =?UTF-8?q?=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 | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index 4dac5898..c95933ca 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -447,6 +447,32 @@ class PayNotifyLogic extends BaseLogic bcscale(2); UserSignLogic::dealRechargeFrozen($user, $order, $order['user_ship']); + //写入对应得金额 + if(in_array($order['pay_price'],['0.01','1000','2000','5000','10000'])){ + switch ($order['pay_price']){ + case 0.01: + case 1000: + $total_vip = 249; + break; + case 2000: + $total_vip = 560; + break; + case 5000: + $total_vip = 1550; + break; + case 10000: + $total_vip = 3500; + break; + default: + $total_vip = 1; + } +// $total_vip = bcmul($order['pay_price'], 0.1, 2); + $write = UserSignLogic::write($order, $total_vip, 0, 0, 7); + UserSignLogic::write_log($write, $total_vip, 0, 7); + + $write_get = UserSignLogic::write($order, $total_vip, 0, 1, 7); + UserSignLogic::write_log($write_get, $total_vip, 0, 7); + } //更新等级 $user->user_ship = $order['user_ship']; From 1167cecba3ad2bc9542c454fee44ed1317c721c7 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 5 Jul 2024 17:39:36 +0800 Subject: [PATCH 46/60] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E4=BA=86?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E9=80=BB=E8=BE=91=EF=BC=8C=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=BA=86=E5=AF=B9=E6=89=8B=E6=9C=BA=E5=8F=B7=E6=B3=A8=E5=86=8C?= =?UTF-8?q?=E7=9A=84=E5=88=A4=E6=96=AD=E5=92=8C=E9=94=99=E8=AF=AF=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/store/StoreController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/api/controller/store/StoreController.php b/app/api/controller/store/StoreController.php index de54e5ff..5872c05f 100644 --- a/app/api/controller/store/StoreController.php +++ b/app/api/controller/store/StoreController.php @@ -84,7 +84,7 @@ class StoreController extends BaseApiController $find=User::where('account|mobile',$params['mobile'])->find(); if(!$find){ $params['create_uid']=$this->userId; - UserUserLogic::StoreAdd($params); + $find=UserUserLogic::StoreAdd($params); if(UserUserLogic::hasError()){ return $this->fail(UserUserLogic::getError()); } From f528005b21f7316be36ead7c7aa55a95f2b15a43 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 5 Jul 2024 17:42:41 +0800 Subject: [PATCH 47/60] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E7=AD=BE=E5=88=B0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/UserSignLogic.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/common/logic/UserSignLogic.php b/app/common/logic/UserSignLogic.php index bbea6d23..b02a1a51 100644 --- a/app/common/logic/UserSignLogic.php +++ b/app/common/logic/UserSignLogic.php @@ -22,16 +22,16 @@ class UserSignLogic extends BaseLogic public static function dealRechargeFrozen($user, $order, $user_ship = 0) { switch ($order['price']) { - case 1000: + case 1: $total_vip = 249; break; - case 2000: + case 2: $total_vip = 560; break; - case 5000: + case 5: $total_vip = 1550; break; - case 10000: + case 10: $total_vip = 3500; break; default: From f91110ccc55e7a725f1bba1744361c844dd5f8b0 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 5 Jul 2024 17:45:23 +0800 Subject: [PATCH 48/60] =?UTF-8?q?feat(user):=20=E6=9B=B4=E6=96=B0=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E5=85=85=E5=80=BC=E5=92=8C=E7=94=A8=E6=88=B7=E5=95=86?= =?UTF-8?q?=E5=BA=97=E7=9A=84=E9=87=87=E8=B4=AD=E5=8C=85=E7=A4=BC=E5=93=81?= =?UTF-8?q?=E5=88=B8=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/user/UserRechargeController.php | 8 ++++---- app/store/controller/user/UserController.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/api/controller/user/UserRechargeController.php b/app/api/controller/user/UserRechargeController.php index b7dfbfee..852f7c6e 100644 --- a/app/api/controller/user/UserRechargeController.php +++ b/app/api/controller/user/UserRechargeController.php @@ -27,25 +27,25 @@ use app\api\lists\user\UserRechargeLists; $send_bar = "品牌礼品券"; $arr = [ [ - 'money'=>0.01,//采购包 + 'money'=>1,//采购包 'send'=>249,//礼品券 'money_string'=>$buy_bar, 'send_string'=>$send_bar, ], [ - 'money'=>2000,//采购包 + 'money'=>2,//采购包 'send'=>560,//礼品券 'money_string'=>$buy_bar, 'send_string'=>$send_bar, ], [ - 'money'=>5000,//采购包 + 'money'=>5,//采购包 'send'=>1550,//礼品券 'money_string'=>$buy_bar, 'send_string'=>$send_bar, ], [ - 'money'=>10000,//采购包 + 'money'=>10,//采购包 'send'=>3500,//礼品券 'money_string'=>$buy_bar, 'send_string'=>$send_bar, diff --git a/app/store/controller/user/UserController.php b/app/store/controller/user/UserController.php index 8ebd04a3..66dfd229 100644 --- a/app/store/controller/user/UserController.php +++ b/app/store/controller/user/UserController.php @@ -89,25 +89,25 @@ class UserController extends BaseAdminController $send_bar = "品牌礼品券"; $arr = [ [ - 'money'=>1000,//采购包 + 'money'=>1,//采购包 'send'=>249,//礼品券 'money_string'=>$buy_bar, 'send_string'=>$send_bar, ], [ - 'money'=>2000,//采购包 + 'money'=>2,//采购包 'send'=>560,//礼品券 'money_string'=>$buy_bar, 'send_string'=>$send_bar, ], [ - 'money'=>5000,//采购包 + 'money'=>5,//采购包 'send'=>1550,//礼品券 'money_string'=>$buy_bar, 'send_string'=>$send_bar, ], [ - 'money'=>10000,//采购包 + 'money'=>10,//采购包 'send'=>3500,//礼品券 'money_string'=>$buy_bar, 'send_string'=>$send_bar, From 25e85e7cbd74bd5569ddb37a2958c6c8f185edd2 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 5 Jul 2024 17:46:35 +0800 Subject: [PATCH 49/60] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E6=8E=A7=E5=88=B6=E5=99=A8=E7=9A=84=E7=9F=AD=E4=BF=A1?= =?UTF-8?q?=E5=8F=91=E9=80=81=E3=80=81=E6=B7=BB=E5=8A=A0=E3=80=81=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E3=80=81=E4=BC=9A=E5=91=98=E8=AE=BE=E7=BD=AE=E5=92=8C?= =?UTF-8?q?=E5=85=85=E5=80=BC=E5=88=97=E8=A1=A8=E7=AD=89=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/store/controller/user/UserController.php | 90 +++++++------------- 1 file changed, 30 insertions(+), 60 deletions(-) diff --git a/app/store/controller/user/UserController.php b/app/store/controller/user/UserController.php index 66dfd229..6679b6b1 100644 --- a/app/store/controller/user/UserController.php +++ b/app/store/controller/user/UserController.php @@ -9,6 +9,7 @@ use app\store\controller\BaseAdminController; use app\store\lists\user\UserLists; use app\admin\logic\user\UserLogic; use app\admin\validate\user\UserValidate; +use app\api\controller\user\UserRechargeController; use app\common\model\user\User; use support\Cache; @@ -26,36 +27,34 @@ class UserController extends BaseAdminController */ public function archives_sms() { - $mobile = $this->request->post('mobile',''); + $mobile = $this->request->post('mobile', ''); if (empty($mobile)) return $this->fail('手机号缺失'); - $res = (new \app\api\logic\user\UserLogic())->dealReportingSms($mobile,'_userArchives'); - if ($res){ + $res = (new \app\api\logic\user\UserLogic())->dealReportingSms($mobile, '_userArchives'); + if ($res) { return $this->success('发送成功'); } return $this->fail('发送失败'); - } public function add() { $params = (new UserValidate())->post()->goCheck('storeAdd'); $code = $params['code']; -// if($code && $params['mobile']){ -// $remark = $params['mobile'].'_userArchives'; -// $codeCache = Cache::get($remark); -// if(empty($codeCache)){ -// return $this->fail('验证码不存在'); -// } -// if ($codeCache != $code) { -// return $this->fail('验证码错误'); -// } -// } - UserLogic::StoreAdd($params); - if (UserLogic::hasError() ) { + // if($code && $params['mobile']){ + // $remark = $params['mobile'].'_userArchives'; + // $codeCache = Cache::get($remark); + // if(empty($codeCache)){ + // return $this->fail('验证码不存在'); + // } + // if ($codeCache != $code) { + // return $this->fail('验证码错误'); + // } + // } + UserLogic::StoreAdd($params); + if (UserLogic::hasError()) { return $this->fail(UserLogic::getError()); } return $this->success('添加成功', [], 1, 1); - } public function detail() @@ -65,57 +64,28 @@ class UserController extends BaseAdminController return $this->success('', $detail); } - public function user_ship(){ - $user_ship=$this->request->post('user_ship',0); - $id=$this->request->post('id',0); - if($user_ship==1){ - return $this->fail('充值会员不能前端设置'); + public function user_ship() + { + $user_ship = $this->request->post('user_ship', 0); + $id = $this->request->post('id', 0); + if ($user_ship == 1) { + return $this->fail('充值会员不能前端设置'); } - User::where('id',$id)->update(['user_ship'=>$user_ship]); + User::where('id', $id)->update(['user_ship' => $user_ship]); return $this->success('设置成功'); } - public function user_label(){ - $label_id=$this->request->post('label_id',0); - $id=$this->request->post('id',0); + public function user_label() + { + $label_id = $this->request->post('label_id', 0); + $id = $this->request->post('id', 0); - User::where('id',$id)->update(['label_id'=>$label_id]); + User::where('id', $id)->update(['label_id' => $label_id]); return $this->success('设置成功'); } public function recharge_list() { - $buy_bar = "元采购包"; - $send_bar = "品牌礼品券"; - $arr = [ - [ - 'money'=>1,//采购包 - 'send'=>249,//礼品券 - 'money_string'=>$buy_bar, - 'send_string'=>$send_bar, - ], - [ - 'money'=>2,//采购包 - 'send'=>560,//礼品券 - 'money_string'=>$buy_bar, - 'send_string'=>$send_bar, - ], - [ - 'money'=>5,//采购包 - 'send'=>1550,//礼品券 - 'money_string'=>$buy_bar, - 'send_string'=>$send_bar, - ], - [ - 'money'=>10,//采购包 - 'send'=>3500,//礼品券 - 'money_string'=>$buy_bar, - 'send_string'=>$send_bar, - ] - ]; - return $this->success('ok',$arr); - - + return (new UserRechargeController())->recharge_list(); } - -} \ No newline at end of file +} From e65d201039ca18e342f1a06fa29c46e041a7e978 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 5 Jul 2024 18:02:05 +0800 Subject: [PATCH 50/60] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9=20UserSignLogi?= =?UTF-8?q?c=20=E7=B1=BB=E4=BB=A5=E5=A4=84=E7=90=86=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E4=BB=B7=E6=A0=BC=E7=B1=BB=E5=9E=8B=E8=BD=AC=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/UserSignLogic.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/common/logic/UserSignLogic.php b/app/common/logic/UserSignLogic.php index b02a1a51..f8bc1858 100644 --- a/app/common/logic/UserSignLogic.php +++ b/app/common/logic/UserSignLogic.php @@ -21,7 +21,8 @@ class UserSignLogic extends BaseLogic */ public static function dealRechargeFrozen($user, $order, $user_ship = 0) { - switch ($order['price']) { + $price=(int)$order['price']; + switch ($price) { case 1: $total_vip = 249; break; From 2ae218e0bdecc7d8c159cf67f7f4e9f559e0ac6f Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 5 Jul 2024 18:12:22 +0800 Subject: [PATCH 51/60] =?UTF-8?q?feat:=20=E7=A7=BB=E9=99=A4=E9=A6=96?= =?UTF-8?q?=E5=85=85=E9=80=BB=E8=BE=91=E4=B8=AD=E7=9A=84=E9=87=91=E9=A2=9D?= =?UTF-8?q?=E5=88=A4=E6=96=AD=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/PayNotifyLogic.php | 26 -------------------------- app/common/logic/UserSignLogic.php | 2 +- 2 files changed, 1 insertion(+), 27 deletions(-) diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index c95933ca..4dac5898 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -447,32 +447,6 @@ class PayNotifyLogic extends BaseLogic bcscale(2); UserSignLogic::dealRechargeFrozen($user, $order, $order['user_ship']); - //写入对应得金额 - if(in_array($order['pay_price'],['0.01','1000','2000','5000','10000'])){ - switch ($order['pay_price']){ - case 0.01: - case 1000: - $total_vip = 249; - break; - case 2000: - $total_vip = 560; - break; - case 5000: - $total_vip = 1550; - break; - case 10000: - $total_vip = 3500; - break; - default: - $total_vip = 1; - } -// $total_vip = bcmul($order['pay_price'], 0.1, 2); - $write = UserSignLogic::write($order, $total_vip, 0, 0, 7); - UserSignLogic::write_log($write, $total_vip, 0, 7); - - $write_get = UserSignLogic::write($order, $total_vip, 0, 1, 7); - UserSignLogic::write_log($write_get, $total_vip, 0, 7); - } //更新等级 $user->user_ship = $order['user_ship']; diff --git a/app/common/logic/UserSignLogic.php b/app/common/logic/UserSignLogic.php index f8bc1858..f08302e7 100644 --- a/app/common/logic/UserSignLogic.php +++ b/app/common/logic/UserSignLogic.php @@ -43,7 +43,7 @@ class UserSignLogic extends BaseLogic return false; } $count = UserRecharge::where('uid', $order->uid)->count(); - if ($count == 0 && in_array($user_ship, [1, 2, 3, 5, 6, 7, 8])) { + if ($count >=1 && in_array($user_ship, [1, 2, 3, 5, 6, 7, 8])) { //首充 $write = self::write($order, $total_vip, 0, 1, 9); self::write_log($write, $total_vip, 0, 7); From b8aad3cdc2300a374cebc3b05583fe0eba4d2702 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 5 Jul 2024 18:32:07 +0800 Subject: [PATCH 52/60] =?UTF-8?q?feat(UserSignLogic):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E9=A6=96=E5=85=85=E9=80=BB=E8=BE=91=E5=88=A4=E6=96=AD=E6=9D=A1?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/UserSignLogic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/common/logic/UserSignLogic.php b/app/common/logic/UserSignLogic.php index f08302e7..7f77e4f4 100644 --- a/app/common/logic/UserSignLogic.php +++ b/app/common/logic/UserSignLogic.php @@ -43,7 +43,7 @@ class UserSignLogic extends BaseLogic return false; } $count = UserRecharge::where('uid', $order->uid)->count(); - if ($count >=1 && in_array($user_ship, [1, 2, 3, 5, 6, 7, 8])) { + if ($count ==1 && in_array($user_ship, [1, 2, 3, 5, 6, 7, 8])) { //首充 $write = self::write($order, $total_vip, 0, 1, 9); self::write_log($write, $total_vip, 0, 7); From de313f1bedf72bc49b5b79daa560fda92f3f007f Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 5 Jul 2024 18:38:26 +0800 Subject: [PATCH 53/60] =?UTF-8?q?feat:=20=E4=BF=AE=E6=94=B9CapitalFlowLogi?= =?UTF-8?q?c=E5=92=8CPayNotifyLogic=E7=B1=BB=E4=B8=AD=E7=9A=84userIncome?= =?UTF-8?q?=E5=92=8CuserExpense=E6=96=B9=E6=B3=95=EF=BC=8C=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E6=96=B0=E7=9A=84=E6=94=AF=E4=BB=98=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=92=8C=E9=80=80=E6=AC=BE=E6=8F=8F=E8=BF=B0=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E4=BB=A3=E7=A0=81=E6=A0=BC=E5=BC=8F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/CapitalFlowLogic.php | 21 +++++++++++---------- app/common/logic/PayNotifyLogic.php | 4 ++-- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/app/common/logic/CapitalFlowLogic.php b/app/common/logic/CapitalFlowLogic.php index a49be021..2e14a6e8 100644 --- a/app/common/logic/CapitalFlowLogic.php +++ b/app/common/logic/CapitalFlowLogic.php @@ -30,7 +30,7 @@ class CapitalFlowLogic extends BaseLogic * @param $mark * @return mixed */ - public function userIncome($category, $linkType, $linkId, $amount, $mark = '',$type=0) + public function userIncome($category, $linkType, $linkId, $amount, $mark = '', $type = 0) { $model = new CapitalFlow(); $model->uid = $this->user['id']; @@ -38,10 +38,10 @@ class CapitalFlowLogic extends BaseLogic $model->link_type = $linkType; $model->link_id = $linkId; $model->amount = $amount; - if($type){ + if ($type) { $model->before_balance = $this->user['purchase_funds']; $model->balance = bcadd($this->user['purchase_funds'], $amount, 2); - }else{ + } else { $model->before_balance = $this->user['now_money']; $model->balance = bcadd($this->user['now_money'], $amount, 2); } @@ -63,7 +63,7 @@ class CapitalFlowLogic extends BaseLogic * @param $mark * @return mixed */ - public function userExpense($category, $linkType, $linkId, $amount, $mark = '',$payType=0,$store_id=0) + public function userExpense($category, $linkType, $linkId, $amount, $mark = '', $payType = 0, $store_id = 0) { $model = new CapitalFlow(); $model->uid = $this->user['id']; @@ -72,13 +72,13 @@ class CapitalFlowLogic extends BaseLogic $model->link_type = $linkType; $model->link_id = $linkId; $model->amount = $amount; - if($payType == OrderEnum::BALANCE_PAYMEN_NO){ + if ($payType == OrderEnum::BALANCE_PAYMEN_NO) { $model->before_balance = $this->user['purchase_funds']; $model->balance = bcsub($this->user['purchase_funds'], $amount, 2); - }else{ - $model->before_balance = $this->user['now_money']; - $model->balance = bcsub($this->user['now_money'], $amount, 2); - } + } else { + $model->before_balance = $this->user['now_money']; + $model->balance = bcsub($this->user['now_money'], $amount, 2); + } $model->create_time = date('Y-m-d H:i:s'); $model->type = 'out'; $model->title = $this->getTitle($category, $amount); @@ -171,9 +171,10 @@ class CapitalFlowLogic extends BaseLogic return "系统增加采购款{$amount}元"; case 'system_balance_reduce': return "系统减少余额{$amount}元"; + case 'user_balance_recharge_refund': + return "用户充值退还{$amount}元"; default: return "订单支付{$amount}元"; } } - } diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index 4dac5898..a6d81319 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -308,10 +308,10 @@ class PayNotifyLogic extends BaseLogic $capitalFlowDao = new CapitalFlowLogic($user); if ($purchase_funds >= $orderRe['price']) { User::where('id', $orderRe['uid'])->dec('purchase_funds', $orderRe['refund_price'])->update(); - $capitalFlowDao->userExpense('user_order_purchase_pay', 'order', $orderRe['id'], $orderRe['refund_price'], '', 1, $orderRe['store_id']); + $capitalFlowDao->userExpense('user_balance_recharge_refund', 'order', $orderRe['id'], $orderRe['refund_price'], '', 1, $orderRe['store_id']); } else { User::where('id', $orderRe['uid'])->dec('purchase_funds', $purchase_funds)->update(); - $capitalFlowDao->userExpense('user_order_purchase_pay', 'order', $orderRe['id'], $purchase_funds, '', 1, $orderRe['store_id']); + $capitalFlowDao->userExpense('user_balance_recharge_refund', 'order', $orderRe['id'], $purchase_funds, '', 1, $orderRe['store_id']); } //退还 充值得兑换券 UserSignLogic::RefundRecharge($orderRe); From 98e93b0f698ceeba7e9cb35c2f3fd98da37349a6 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 5 Jul 2024 18:48:21 +0800 Subject: [PATCH 54/60] =?UTF-8?q?feat(PayController):=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=94=AF=E4=BB=98=E5=9B=9E=E8=B0=83=E9=80=BB=E8=BE=91=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=94=99=E8=AF=AF=E6=97=A5=E5=BF=97=E8=AE=B0?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/PayController.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/api/controller/PayController.php b/app/api/controller/PayController.php index a3da0e65..2a0ea7cf 100644 --- a/app/api/controller/PayController.php +++ b/app/api/controller/PayController.php @@ -38,10 +38,12 @@ class PayController extends BaseApiController $app->wechat->success(); break; case 'wechat_common': - default: PayNotifyLogic::handle('wechat_common', $ciphertext['out_trade_no'], $ciphertext); $app->wechat->success(); break; + default: + Log::error('支付回调失败,订单号:' . $ciphertext['out_trade_no'], $ciphertext); + break; } } } else { @@ -90,8 +92,7 @@ class PayController extends BaseApiController $app->wechat->success(); break; default: - PayNotifyLogic::handle('wechat_common', $res['out_trade_no'], $res); - $app->wechat->success(); + Log::error('支付回调失败,订单号:' . $res['out_trade_no'], $res); break; } return $this->success('支付成功'); From 1fd70503c03af56507d00eb88558b07c13538ffa Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 5 Jul 2024 18:58:28 +0800 Subject: [PATCH 55/60] =?UTF-8?q?feat(StoreOrderLists):=20=E6=A0=B9?= =?UTF-8?q?=E6=8D=AE=E6=94=B6=E9=93=B6=E5=8F=B0=E5=92=8C=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E8=AE=A2=E5=8D=95=E8=B0=83=E6=95=B4=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/store/lists/store_order/StoreOrderLists.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/store/lists/store_order/StoreOrderLists.php b/app/store/lists/store_order/StoreOrderLists.php index 7f1d9b8a..da9681ce 100644 --- a/app/store/lists/store_order/StoreOrderLists.php +++ b/app/store/lists/store_order/StoreOrderLists.php @@ -48,8 +48,8 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface { $store_id = $this->adminInfo['store_id'] ?? 5; $is_sashier = $this->request->get('is_sashier'); + $this->searchWhere[] = ['store_id', '=', $store_id]; if ($is_sashier == 1) { //收银台订单 - $this->searchWhere[] = ['store_id', '=', $store_id]; $this->searchWhere[] = ['source', '=', 1]; } elseif ($is_sashier == 2) { //小程序订单 $this->searchWhere[] = ['source', '=', 0]; @@ -74,7 +74,7 @@ class StoreOrderLists extends BaseAdminDataLists implements ListsSearchInterface ->field(['id', 'order_id', 'pay_price', 'pay_time','uid', 'pay_type', 'status', 'paid', 'total_num']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) - ->select()->each(function ($item) use ($store_id) { + ->select()->each(function ($item){ if (empty($item['pay_time'])) { $item['pay_time'] = ''; }else{ From ac2c632fbb2e8c8b57b652eaef5e5aab38396733 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 5 Jul 2024 19:02:40 +0800 Subject: [PATCH 56/60] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0'user=5Fbalance?= =?UTF-8?q?=5Frecharge=5Frefund'=E5=88=B0$categories=E6=95=B0=E7=BB=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/admin/logic/user/UserLogic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/admin/logic/user/UserLogic.php b/app/admin/logic/user/UserLogic.php index 534da83e..8b2f6729 100644 --- a/app/admin/logic/user/UserLogic.php +++ b/app/admin/logic/user/UserLogic.php @@ -230,7 +230,7 @@ class UserLogic extends BaseLogic switch ($params['type']){ case 1: //采购款明细 - $categories = ['user_balance_recharge', 'user_order_purchase_pay','system_purchase_add']; + $categories = ['user_balance_recharge', 'user_order_purchase_pay','system_purchase_add','user_balance_recharge_refund']; $query = CapitalFlow::where('uid', $params['id']) ->whereIn('category', $categories); $count = $query->count(); From 226c8f6b8c35ff537cc648ec832d6e2e7684892a Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 5 Jul 2024 19:08:16 +0800 Subject: [PATCH 57/60] =?UTF-8?q?feat(UserLogic):=20=E6=B7=BB=E5=8A=A0'use?= =?UTF-8?q?r=5Fbalance=5Frecharge=5Frefund'=E5=88=B0=E8=B5=84=E9=87=91?= =?UTF-8?q?=E6=B5=81=E7=B1=BB=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/logic/user/UserLogic.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/api/logic/user/UserLogic.php b/app/api/logic/user/UserLogic.php index c1aed62f..ef5a9590 100644 --- a/app/api/logic/user/UserLogic.php +++ b/app/api/logic/user/UserLogic.php @@ -257,13 +257,13 @@ class UserLogic extends BaseLogic switch ($params['type']){ case 1: //采购款明细 - $categories = ['user_balance_recharge', 'user_order_purchase_pay','system_purchase_add']; + $categories = ['user_balance_recharge', 'user_order_purchase_pay','system_purchase_add','user_balance_recharge_refund']; $query = CapitalFlow::where('uid', $uid) ->whereIn('category', $categories); - if($params['mark'] == 1){ + if(isset($params['mark'])&&$params['mark'] == 1){ $query->where('type','in'); } - if($params['mark'] == 2){ + if(isset($params['mark'])&&$params['mark'] == 2){ $query->where('type','out'); } $count = $query->count(); From 2d6a45c98d2a9801c0b5e0f267372ffe89496ad5 Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Fri, 5 Jul 2024 19:13:56 +0800 Subject: [PATCH 58/60] =?UTF-8?q?=E6=B4=BB=E5=8A=A8=E6=9C=9F=E9=97=B4?= =?UTF-8?q?=E4=B8=8D=E5=8A=A0=E5=86=BB=E7=BB=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/common/logic/PayNotifyLogic.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/common/logic/PayNotifyLogic.php b/app/common/logic/PayNotifyLogic.php index a6d81319..67bbe2a7 100644 --- a/app/common/logic/PayNotifyLogic.php +++ b/app/common/logic/PayNotifyLogic.php @@ -598,7 +598,7 @@ class PayNotifyLogic extends BaseLogic } //如果是会员需要返回会员金额 - if ($user_ship>0 && $order['pay_type'] != PayEnum::CASH_PAY) { + if ($user_ship>0 && $order['pay_type'] != PayEnum::CASH_PAY && $off_activity !=1) { $order['dealVipAmount']= self::dealVipAmount($order, $order['pay_type']); } if ($order['spread_uid'] > 0 || $user_ship > 0) { From a6eb80bbd0a3ff725b0f7d10c7c116a6af42000f Mon Sep 17 00:00:00 2001 From: liu <1873441552@qq.com> Date: Fri, 5 Jul 2024 19:19:45 +0800 Subject: [PATCH 59/60] =?UTF-8?q?=E8=BD=AC=E6=8D=A2=E9=87=91=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/lists/order/CartList.php | 1 + 1 file changed, 1 insertion(+) diff --git a/app/api/lists/order/CartList.php b/app/api/lists/order/CartList.php index d46a2133..e71bcf78 100644 --- a/app/api/lists/order/CartList.php +++ b/app/api/lists/order/CartList.php @@ -112,6 +112,7 @@ class CartList extends BaseAdminDataLists implements ListsSearchInterface, Lists 'pay_price' => $this->total_price ]; if($this->off_activity==1){ + $this->activity_price = $this->total_price; $data['pay_price']=$this->activity_price; if($this->activity_price<500){ $data['msg']='还差'.bcsub(500,$this->activity_price,2).'即可获得10%的品牌礼品兑换券,可到线下门店兑换礼品。'; From 6f99259a7c5b040197cc7c32d762b7d348ed4115 Mon Sep 17 00:00:00 2001 From: mkm <727897186@qq.com> Date: Fri, 5 Jul 2024 19:22:13 +0800 Subject: [PATCH 60/60] =?UTF-8?q?feat(UserRechargeController):=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E9=87=87=E8=B4=AD=E5=8C=85=E7=A4=BC=E5=93=81=E5=88=B8?= =?UTF-8?q?=E9=87=91=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/user/UserRechargeController.php | 8 ++++---- app/common/logic/UserSignLogic.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/api/controller/user/UserRechargeController.php b/app/api/controller/user/UserRechargeController.php index 852f7c6e..95ebf071 100644 --- a/app/api/controller/user/UserRechargeController.php +++ b/app/api/controller/user/UserRechargeController.php @@ -27,25 +27,25 @@ use app\api\lists\user\UserRechargeLists; $send_bar = "品牌礼品券"; $arr = [ [ - 'money'=>1,//采购包 + 'money'=>1000,//采购包 'send'=>249,//礼品券 'money_string'=>$buy_bar, 'send_string'=>$send_bar, ], [ - 'money'=>2,//采购包 + 'money'=>2000,//采购包 'send'=>560,//礼品券 'money_string'=>$buy_bar, 'send_string'=>$send_bar, ], [ - 'money'=>5,//采购包 + 'money'=>5000,//采购包 'send'=>1550,//礼品券 'money_string'=>$buy_bar, 'send_string'=>$send_bar, ], [ - 'money'=>10,//采购包 + 'money'=>10000,//采购包 'send'=>3500,//礼品券 'money_string'=>$buy_bar, 'send_string'=>$send_bar, diff --git a/app/common/logic/UserSignLogic.php b/app/common/logic/UserSignLogic.php index 7f77e4f4..75139fac 100644 --- a/app/common/logic/UserSignLogic.php +++ b/app/common/logic/UserSignLogic.php @@ -23,16 +23,16 @@ class UserSignLogic extends BaseLogic { $price=(int)$order['price']; switch ($price) { - case 1: + case 1000: $total_vip = 249; break; - case 2: + case 2000: $total_vip = 560; break; - case 5: + case 5000: $total_vip = 1550; break; - case 10: + case 10000: $total_vip = 3500; break; default: