From 9d55f0f73dc4c824220f67193910f77a24af2b0f Mon Sep 17 00:00:00 2001 From: limu Date: Fri, 29 Dec 2023 10:39:44 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=9D=83=E9=99=90=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- route/admin/role.php | 51 ++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/route/admin/role.php b/route/admin/role.php index cedfd25..a9067e4 100644 --- a/route/admin/role.php +++ b/route/admin/role.php @@ -15,16 +15,16 @@ use app\common\middleware\AdminTokenMiddleware; use app\common\middleware\AllowOriginMiddleware; use app\common\middleware\LogMiddleware; -Route::group(function () { - //身份规则 +Route::group(function () { +//身份规则 Route::group('system/role', function () { Route::get('lst', '/getList')->name('systemRoleGetList')->option([ '_alias' => '身份列表', - ]); + ]); Route::post('create', '/create')->name('systemRoleCreate')->option([ '_alias' => '身份添加', - ]); + ]); Route::get('create/form', '/createForm')->name('systemRoleCreateForm')->option([ '_alias' => '身份添加表单', '_auth' => false, @@ -32,7 +32,7 @@ Route::group(function () { ]); Route::post('update/:id', '/update')->name('systemRoleUpdate')->option([ '_alias' => '身份编辑', - ]); + ]); Route::get('update/form/:id', '/updateForm')->name('systemRoleUpdateForm')->option([ '_alias' => '身份编辑表单', '_auth' => false, @@ -40,23 +40,23 @@ Route::group(function () { ]); Route::post('status/:id', '/switchStatus')->name('systemRoleStatus')->option([ '_alias' => '身份修改状态', - ]); + ]); Route::delete('delete/:id', '/delete')->name('systemRoleDelete')->option([ '_alias' => '身份删除', - ]); + ]); })->prefix('admin.system.auth.Role')->option([ '_path' => '/setting/systemRole', '_auth' => true, ]); - //Admin管理 +//Admin管理 Route::group('system/admin', function () { Route::get('lst', '.Admin/getList')->name('systemAdminLst')->option([ '_alias' => '管理员列表', - ]); + ]); Route::post('status/:id', '.Admin/switchStatus')->name('systemAdminStatus')->option([ '_alias' => '管理员修改状态', - ]); + ]); Route::get('create/form', '.Admin/createForm')->name('systemAdminCreateForm')->option([ '_alias' => '管理员添加表单', '_auth' => false, @@ -64,7 +64,7 @@ Route::group(function () { ]); Route::post('create', '.Admin/create')->name('systemAdminCreate')->option([ '_alias' => '管理员添加', - ]); + ]); Route::get('update/form/:id', '.Admin/updateForm')->name('systemAdminUpdateForm')->option([ '_alias' => '管理员编辑表单', @@ -82,33 +82,33 @@ Route::group(function () { ]); Route::post('password/:id', '.Admin/password')->name('systemAdminPassword')->option([ '_alias' => '管理员修改密码', - ]); + ]); Route::delete('delete/:id', '.Admin/delete')->name('systemAdminDelete')->option([ '_alias' => '管理员删除', - ]); + ]); Route::get('log', '.AdminLog/lst')->name('systemAdminLog')->option([ '_alias' => '操作日志', - '_path' => '/setting/systemLog', + '_path' => '/setting/systemLog', ]); })->prefix('admin.system.admin')->option([ '_path' => '/setting/systemAdmin', '_auth' => true, - '_append'=> [ + '_append' => [ [ - '_name' =>'uploadImage', - '_path' =>'/setting/systemAdmin', + '_name' => 'uploadImage', + '_path' => '/setting/systemAdmin', '_alias' => '上传图片', - '_auth' => true, + '_auth' => true, ], [ - '_name' =>'systemAttachmentLst', - '_path' =>'/setting/systemAdmin', + '_name' => 'systemAttachmentLst', + '_path' => '/setting/systemAdmin', '_alias' => '图片列表', - '_auth' => true, + '_auth' => true, ], ] ]); @@ -135,10 +135,10 @@ Route::group(function () { '_auth' => true, ]); - //合伙人角色 Route::group('partner/role', function () { Route::get('list', '.Partner/list')->name('systemPartnerList')->option([ '_alias' => '合作人角色列表', + '_auth' => false, ]); Route::post('add', '.Partner/add')->name('systemPartnerAdd')->option([ '_alias' => '添加合作人角色', @@ -156,13 +156,12 @@ Route::group(function () { '_alias' => '读取合作人大区', ]); })->prefix('admin.system.admin')->option([ - '_path' => 'self', - '_auth' => true, + '_auth' => false, ]); - - })->middleware(AllowOriginMiddleware::class) ->middleware(AdminTokenMiddleware::class, true) ->middleware(AdminAuthMiddleware::class) ->middleware(LogMiddleware::class); + + From a2a9e62c1c7697d3ae6c1cd9714f2e3587fcb948 Mon Sep 17 00:00:00 2001 From: limu Date: Fri, 29 Dec 2023 12:17:11 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=88=A4=E6=96=AD=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/command/dayValue.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/command/dayValue.php b/app/command/dayValue.php index ef0e053..22f1ea8 100644 --- a/app/command/dayValue.php +++ b/app/command/dayValue.php @@ -122,7 +122,7 @@ class dayValue extends Command $user_temp = bcdiv($temp_value, (string)$num, 2); foreach ($nlv['uid'] as $uk => $uv) { $user = User::getDB()->where('uid', $uv)->find(); - if($user->pay_price > 0){ + //if($user->pay_price > 0){ $user->all_value = bcadd($user->all_value, $user_temp, 2); $user->save(); $user_log_data[] = [ @@ -133,7 +133,7 @@ class dayValue extends Command 'memo' => $nlv['alias'] . '贡献值', 'user_id' => $uv, ]; - } + //} } From 651732008c758b6c87683d21f625ba2465814e87 Mon Sep 17 00:00:00 2001 From: limu Date: Fri, 29 Dec 2023 14:37:26 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=99=9A=E6=8B=9F=E5=8F=91=E8=B4=A7?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../store/order/StoreOrderRepository.php | 1 + crmeb/jobs/OrderPartnerJob.php | 32 +++++++++---------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/app/common/repositories/store/order/StoreOrderRepository.php b/app/common/repositories/store/order/StoreOrderRepository.php index 6c357f0..45823bb 100644 --- a/app/common/repositories/store/order/StoreOrderRepository.php +++ b/app/common/repositories/store/order/StoreOrderRepository.php @@ -1309,6 +1309,7 @@ class StoreOrderRepository extends BaseRepository ]; $statusRepository->createSysLog($orderStatus); + Queue::push(OrderPartnerJob::class, $order->toArray()); } if (isset($temp_code)) Queue::push(SendSmsJob::class, ['tempId' => $temp_code, 'id' => $order->order_id]); diff --git a/crmeb/jobs/OrderPartnerJob.php b/crmeb/jobs/OrderPartnerJob.php index cf7f4d8..eebe651 100644 --- a/crmeb/jobs/OrderPartnerJob.php +++ b/crmeb/jobs/OrderPartnerJob.php @@ -33,7 +33,7 @@ use app\common\model\store\order\StoreOrderLevel; class OrderPartnerJob implements JobInterface { - public function fire($job,$data) + public function fire($job, $data) { $job->delete(); file_put_contents('/tmp/debug_partner', '开始处理贡献值订单:' . var_export($data, 1), 8); @@ -155,23 +155,21 @@ class OrderPartnerJob implements JobInterface } //订单角色贡献值-30% $user_value = bcmul($total_price, 0.3, 2); - if ($user_value > 0) { - $user = User::getDB()->where('uid', $data['uid'])->find(); - $user->all_value = bcadd($user->all_value, $user_value, 2); - //增加生命值 - if (!empty($user_hb)) { - $user->hp_value = bcadd($user->hp_value, $user_hb, 2); - } - $user->save(); - $user_log_data[] = [ - 'type' => 6, - 'types_of' => 1, - 'num' => $user_value, - 'ctime' => date('Y-m-d H:i:s'), - 'memo' => '订单消费贡献值', - 'user_id' => $data['uid'], - ]; + $user = User::getDB()->where('uid', $data['uid'])->find(); + $user->all_value = bcadd($user->all_value, $user_value, 2); + //增加生命值 + if (!empty($user_hb)) { + $user->hp_value = bcadd($user->hp_value, $user_hb, 2); } + $user->save(); + $user_log_data[] = [ + 'type' => 6, + 'types_of' => 1, + 'num' => $user_value, + 'ctime' => date('Y-m-d H:i:s'), + 'memo' => '订单消费贡献值', + 'user_id' => $data['uid'], + ]; //处理合作人角色是否包含此商品品牌