From 2fd7085b3c255456a34154e7d5768e25c476cb91 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Fri, 27 Oct 2023 11:50:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9A=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E5=95=86=E5=93=81=E5=8C=BA=E5=9F=9F=E4=BB=A3=E7=90=86=E6=9D=83?= =?UTF-8?q?=E9=87=8D=E5=80=BC=E5=A5=96=E5=8A=B1=E7=94=B1=E5=85=A8=E9=A2=9D?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E4=BF=AE=E6=94=B9=E4=B8=BA=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E6=AF=8F=E4=B8=AA=E5=8C=BA=E5=9F=9F=E4=BB=A3=E7=90=86=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E7=9A=84=E6=9D=83=E9=87=8D=E5=80=BC=E5=A5=96=E5=8A=B1?= =?UTF-8?q?=E6=AF=94=E4=BE=8B=E8=8E=B7=E5=8F=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/admin/AgentController.php | 17 +-- .../src/services/OrderCreatedNewService.php | 4 +- .../views/admin/change-pwd.blade.php | 11 ++ .../views/admin/create-agent.blade.php | 11 +- .../area-dividend/views/admin/list.blade.php | 102 ++++++------------ .../collection-room/src/PluginApplication.php | 5 - .../models/CollectionRoomIdentifierModel.php | 1 + .../weight-value/src/models/WeightValue.php | 15 ++- 8 files changed, 76 insertions(+), 90 deletions(-) diff --git a/plugins/area-dividend/src/admin/AgentController.php b/plugins/area-dividend/src/admin/AgentController.php index 08eed35b..65e9a808 100644 --- a/plugins/area-dividend/src/admin/AgentController.php +++ b/plugins/area-dividend/src/admin/AgentController.php @@ -45,8 +45,7 @@ class AgentController extends BaseController $wq_data = \YunShop::request()->wq; if ($agentData) { - $agent = AreaDividendAgent::getAgentByMemberId($agentData['member_id'])->where('status', '<>', -1) - ->first(); + $agent = AreaDividendAgent::getAgentByMemberId($agentData['member_id'])->where('status', '<>', -1)->first(); $set = Setting::get('plugin.area_dividend'); if (!empty($agent)) { if ($agent->status == 0) { @@ -87,8 +86,7 @@ class AgentController extends BaseController if ($hasAgent && in_array($hasAgent->status, [0, 1])) { return $this->errorJson('添加失败,此会员已是该区域代理商'); } elseif ($hasAgent && $hasAgent->status == -1) { - AreaDividendAgent::uniacid() - ->where('id', $hasAgent->id)->delete(); + AreaDividendAgent::uniacid()->where('id', $hasAgent->id)->delete(); } } @@ -171,19 +169,13 @@ class AgentController extends BaseController { $id = \YunShop::request()->id; $agency = AreaDividendAgent::find($id); - if (!$agency) { - return $this->message('无此区域代理或已经删除', '', 'error'); - } - + if (!$agency) return $this->message('无此区域代理或已经删除', '', 'error'); if ($agency->user_id) { $user = WeiQingUsers::getUserByUid($agency->user_id)->first(); - if (!$user) { - return $this->message('微擎账号不存在', '', 'error'); - } + if (!$user) return $this->message('微擎账号不存在', '', 'error'); } if (request()->isMethod('post')) { - $wq_data = \YunShop::request()->wq; if ($wq_data['password'] && $wq_data['password_again']) { if (trim($wq_data['password_again']) != trim($wq_data['password'])) { @@ -248,6 +240,7 @@ class AgentController extends BaseController $agency->manage = request()->order_manage; $agency->ratio = request()->ratio; + $agency->weight_value_ratio = request()->weight_value_ratio; $agency->has_ratio = request()->has_ratio; if (intval(request()->input('agent')['investor_uid'])) { $agency->investor_uid = intval(request()->input('agent')['investor_uid']); diff --git a/plugins/area-dividend/src/services/OrderCreatedNewService.php b/plugins/area-dividend/src/services/OrderCreatedNewService.php index 2ef22adc..c2e280ee 100644 --- a/plugins/area-dividend/src/services/OrderCreatedNewService.php +++ b/plugins/area-dividend/src/services/OrderCreatedNewService.php @@ -163,8 +163,8 @@ class OrderCreatedNewService continue; } - \Log::debug("省公司权重值处理 - 开始处理",['uid'=>$agent['member_id'],'order_id'=>$areaDividendData['order_id']]); - (new WeightValue())->areaGiveInit($agent['member_id'],$this->order); + \Log::debug("省公司权重值处理 - 开始处理",['uid'=>$agent['member_id'],'order_id'=>$areaDividendData['order_id'],'weight_value_ratio'=>$agent['weight_value_ratio']]); + if((float)$agent['weight_value_ratio'] > 0) (new WeightValue())->areaGiveInit($agent['member_id'],$this->order,$agent['weight_value_ratio']); $exist = AreaDividend::where([ diff --git a/plugins/area-dividend/views/admin/change-pwd.blade.php b/plugins/area-dividend/views/admin/change-pwd.blade.php index 565755c1..9982a282 100644 --- a/plugins/area-dividend/views/admin/change-pwd.blade.php +++ b/plugins/area-dividend/views/admin/change-pwd.blade.php @@ -48,6 +48,17 @@ +