From 10412e6596a968dc086d0c47a84622e37678570d Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Wed, 4 Jun 2025 11:10:59 +0800 Subject: [PATCH 1/6] =?UTF-8?q?=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/orders/Dispatch2.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/admin/controller/orders/Dispatch2.php b/application/admin/controller/orders/Dispatch2.php index 938f372..3fc0022 100644 --- a/application/admin/controller/orders/Dispatch2.php +++ b/application/admin/controller/orders/Dispatch2.php @@ -103,7 +103,7 @@ class Dispatch2 extends Backend } }else{ //已上门 完成时间超了 - if($row->estimated_finish_time > $now) + if($row->estimated_finish_time < $now) { //预估完成时间过了 $row->btn_record = true; } From 2529f9fd5478abe91ee272e77a011602ba8a3bbe Mon Sep 17 00:00:00 2001 From: zhuyu Date: Wed, 4 Jun 2025 11:56:28 +0800 Subject: [PATCH 2/6] feature: auth --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 1d5f725..81d7826 100755 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ .vscode node_modules .user.ini +/application/extra/site.php From 318ced06a7c759397ebf5a4af2a49b39c94ca260 Mon Sep 17 00:00:00 2001 From: zhuyu Date: Wed, 4 Jun 2025 13:34:19 +0800 Subject: [PATCH 3/6] Stop tracking site.php --- application/extra/site.php | 44 -------------------------------------- 1 file changed, 44 deletions(-) delete mode 100755 application/extra/site.php diff --git a/application/extra/site.php b/application/extra/site.php deleted file mode 100755 index 5c7e14d..0000000 --- a/application/extra/site.php +++ /dev/null @@ -1,44 +0,0 @@ - 'Allocatr', - 'beian' => '', - 'cdnurl' => '', - 'version' => '1.0.1', - 'timezone' => 'Asia/Shanghai', - 'forbiddenip' => '', - 'languages' => - array ( - 'backend' => 'zh-cn', - 'frontend' => 'zh-cn', - ), - 'fixedpage' => 'dashboard', - 'categorytype' => - array ( - 'default' => 'Default', - 'page' => 'Page', - 'article' => 'Article', - 'test' => 'Test', - ), - 'configgroup' => - array ( - 'basic' => 'Basic', - 'email' => 'Email', - 'dictionary' => 'Dictionary', - 'user' => 'User', - 'example' => 'Example', - ), - 'attachmentcategory' => - array ( - 'category1' => 'Category1', - 'category2' => 'Category2', - 'custom' => 'Custom', - ), - 'mail_type' => '1', - 'mail_smtp_host' => 'smtp.qq.com', - 'mail_smtp_port' => '465', - 'mail_smtp_user' => '', - 'mail_smtp_pass' => '', - 'mail_verify_type' => '2', - 'mail_from' => '', -); From eae143512fb54a5b281c46026a20f1aa69ee77d5 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Wed, 4 Jun 2025 13:35:32 +0800 Subject: [PATCH 4/6] =?UTF-8?q?=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/common/command/CheckOrdeRecordCommand.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/application/common/command/CheckOrdeRecordCommand.php b/application/common/command/CheckOrdeRecordCommand.php index 4c7f45e..d4df170 100644 --- a/application/common/command/CheckOrdeRecordCommand.php +++ b/application/common/command/CheckOrdeRecordCommand.php @@ -31,8 +31,14 @@ class CheckOrdeRecordCommand extends Command foreach ($list as $item) { $ids[] = $item->id; $dispatchIds[] = $item->dispatch_id; + + $existDispatchIds = []; + //修改状态 if($item->need_notice == 1){ //需要通知 + if(in_array($item->dispatch_id,$existDispatchIds)){ + continue; + } $dispatch = OrderDispatch::get($item->dispatch_id,['orderb']); Message::create([ 'to_id' => $dispatch->admin_id, @@ -40,6 +46,8 @@ class CheckOrdeRecordCommand extends Command 'title' => '派单任务跟进提示', 'content' => '【订单跟进提示】您有一条待跟进订单,订单编号:'.$dispatch->orderb->order_no.',请及时关注。' ]); + + $existDispatchIds[] = $item->dispatch_id; } } OrderDispatchRecord::whereIn('id',$ids)->where('status',0)->update(['status'=>1]); From e53dc1bdd37180352ffdb9b6059e23522cdea4c8 Mon Sep 17 00:00:00 2001 From: xman <1946321327@qq.com> Date: Wed, 4 Jun 2025 13:40:11 +0800 Subject: [PATCH 5/6] =?UTF-8?q?=E9=80=9A=E7=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/services/OrderDispatchService.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/application/services/OrderDispatchService.php b/application/services/OrderDispatchService.php index d8d71a3..3fa9562 100644 --- a/application/services/OrderDispatchService.php +++ b/application/services/OrderDispatchService.php @@ -154,7 +154,7 @@ class OrderDispatchService extends BaseService try { //接单 $orderDispatch->status = $orderDispatchStatus; - + $orderDispatch->follow = 1; //拒接原因 if ($type == 'reject') { if (empty($params['reject_reason'])) { @@ -290,6 +290,7 @@ class OrderDispatchService extends BaseService $orderDispatch = $this->getOrderDispatchInfo($workerId, $orderDispatchId); $orderDispatch->status = OrderDispatch::STATUS_PLANIT; $orderDispatch->plan_time = $planTime; + $orderDispatch->follow = 1; $orderDispatch->save(); $orderDispatch->admin_user = '师傅:'. $orderDispatch->worker_name; @@ -336,6 +337,7 @@ class OrderDispatchService extends BaseService $orderDispatch->status = OrderDispatch::STATUS_CLOCK; $orderDispatch->arrive_images = $this->removeStrCdnUrl($images); $orderDispatch->arrive_time = $time; + $orderDispatch->follow = 1; $orderDispatch->save(); $orderDispatch->admin_user = '师傅:'. $orderDispatch->worker_name; @@ -390,6 +392,7 @@ class OrderDispatchService extends BaseService $orderDispatch = $this->getOrderDispatchInfo($workerId, $params['order_dispatch_id']); $orderDispatch->status = OrderDispatch::STATUS_FINISH; $orderDispatch->images = $this->removeStrCdnUrl($params['complete_images']); + $orderDispatch->follow = 2; $orderDispatch->finish_time = $time; // 材料相关 @@ -463,7 +466,7 @@ class OrderDispatchService extends BaseService $orderDispatch = $this->getOrderDispatchInfo($workerId, $params['order_dispatch_id']); $orderDispatch->is_finish_today = $params['is_finish_today']; $orderDispatch->estimated_finish_time = $params['estimated_finish_time']; - + $orderDispatch->follow = 1; if ($params['is_finish_today'] == 0) { $orderDispatch->work_progress = $params['work_progress']; } From 6b2ef44d68e03455762bc331c5bec2b3a802c5af Mon Sep 17 00:00:00 2001 From: zhuyu Date: Wed, 4 Jun 2025 14:19:36 +0800 Subject: [PATCH 6/6] =?UTF-8?q?feature:=20=E7=99=BB=E5=BD=95=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/library/Auth.php | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/application/admin/library/Auth.php b/application/admin/library/Auth.php index 6e1c61f..8ed9194 100755 --- a/application/admin/library/Auth.php +++ b/application/admin/library/Auth.php @@ -47,6 +47,13 @@ class Auth extends \fast\Auth $this->setError('Admin is forbidden'); return false; } + + //ip白名单校验 + if (!$this->allowIpCheck($admin)) { + $this->setError('登录失败:您的IP地址不在公司允许范围内!'); + return false; + } + if (Config::get('fastadmin.login_failure_retry') && $admin->loginfailure >= 10 && time() - $admin->updatetime < 86400) { $this->setError('Please try again after 1 day'); return false; @@ -68,6 +75,29 @@ class Auth extends \fast\Auth return true; } + public function allowIpCheck($admin){ + + if (in_array('*', $this->getRuleIds($admin->id))) { + return true; + } + + $allowIpCheck = Config::get('site.allowip_check'); + if ($allowIpCheck != 1) { + return true; + } + + $allowIp = Config::get('site.allowip'); + $allowIp = explode("\r\n", $allowIp); + if (empty($allowIp)) { + return false; + } + $ip = request()->ip(); + if (!in_array($ip, $allowIp)) { + return false; + } + return true; + } + /** * 退出登录 */