From a80b289967ef9cc88237d2cc7b54655259822126 Mon Sep 17 00:00:00 2001 From: mzeros Date: Fri, 10 Jan 2025 14:42:38 +0800 Subject: [PATCH] =?UTF-8?q?feat(setting):=20=E6=B7=BB=E5=8A=A0=E6=90=BA?= =?UTF-8?q?=E5=8F=B7=E8=BD=AC=E7=BD=91=E6=89=8B=E6=9C=BA=E5=8F=B7=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 MobileMnp 控制器和相关视图文件 - 实现携号转网手机号检测数据的添加、编辑和删除功能 - 添加条件搜索功能 - 优化订单历史数据获取逻辑,使用 OrderLastweekHistoryService --- app/setting/controller/MobileMnp.php | 112 +++++++++++++++ app/setting/service/AccountLogService.php | 4 +- app/setting/service/ChannelAccountService.php | 3 +- app/setting/view/mobile_mnp/form.html | 136 ++++++++++++++++++ app/setting/view/mobile_mnp/index.html | 111 ++++++++++++++ app/setting/view/mobile_mnp/index_search.html | 88 ++++++++++++ app/task/controller/OrderTask.php | 3 + app/task/controller/Task.php | 5 +- 8 files changed, 458 insertions(+), 4 deletions(-) create mode 100644 app/setting/controller/MobileMnp.php create mode 100644 app/setting/view/mobile_mnp/form.html create mode 100644 app/setting/view/mobile_mnp/index.html create mode 100644 app/setting/view/mobile_mnp/index_search.html diff --git a/app/setting/controller/MobileMnp.php b/app/setting/controller/MobileMnp.php new file mode 100644 index 0000000..ee65735 --- /dev/null +++ b/app/setting/controller/MobileMnp.php @@ -0,0 +1,112 @@ +title = '卡号黑名单'; + $query = $this->_query($this->table); + $query->equal('status,id,is_mnp,mobile,old_isp,new_isp')->dateBetween('create_at'); + // 加载对应数据列表 + $this->type = input('is_mnp', 'all'); + // 列表排序并显示 +// $query->order('status desc,id desc')->page(); + $query->order('status desc,id desc')->layTable(function(QueryHelper $query){ + // 前置操作,处理 HTML 模型 + },function(QueryHelper $query){ +// $vo['isp_name'] = $this->isp[$vo['isp']]; + // 后置操作,处理表格数据 + }); + } + + /** + * 添加携转号码 + * @auth true + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function add() + { + $this->_applyFormToken(); + $this->_form($this->table, 'form'); + } + + /** + * 编辑携转号码检测 + * @auth true + * @throws \think\db\exception\DataNotFoundException + * @throws \think\db\exception\DbException + * @throws \think\db\exception\ModelNotFoundException + */ + public function edit() + { + $this->_applyFormToken(); + $this->_form($this->table, 'form'); + } + + /** + * 修改携转号码检测 + * @auth true + * @throws \think\db\exception\DbException + */ + public function state() + { + $this->_applyFormToken(); + $this->_save($this->table, $this->_vali([ + 'status.in:0,1' => '状态值范围异常!', + 'status.require' => '状态值不能为空!', + ])); + } + + /** + * 删除携转号码检测 + * @auth true + * @throws \think\db\exception\DbException + */ + public function remove() + { +// $this->_applyFormToken(); + $this->_delete($this->table); + } + + +} diff --git a/app/setting/service/AccountLogService.php b/app/setting/service/AccountLogService.php index 30f8be3..e4357e5 100644 --- a/app/setting/service/AccountLogService.php +++ b/app/setting/service/AccountLogService.php @@ -10,6 +10,7 @@ use app\channel\service\ChannelService; use app\merchant\service\MerchantService; use app\merchant\service\MerchantLogService; use app\merchant\service\OrderLastHistoryService; +use app\merchant\service\OrderLastweekHistoryService; use app\merchant\service\OrderService; use app\merchant\service\OrderHistoryService; @@ -83,6 +84,7 @@ use app\setting\service\MerchantAccountService; $day = date('Y-m-d', strtotime('-1 day')); } + $this->merchantLogService = MerchantLogService::instance(); $accountService = AccountService::instance(); $merchantAccountService = MerchantAccountService::instance(); @@ -103,7 +105,7 @@ use app\setting\service\MerchantAccountService; $this->history = true; // $this->orderService = OrderHistoryService::instance(); - $this->orderService = OrderLastHistoryService::instance(); + $this->orderService = OrderLastweekHistoryService::instance(); $begin = $day . ' 00:00:00'; $after = $day . ' 23:59:59'; diff --git a/app/setting/service/ChannelAccountService.php b/app/setting/service/ChannelAccountService.php index db630d2..25c12ae 100644 --- a/app/setting/service/ChannelAccountService.php +++ b/app/setting/service/ChannelAccountService.php @@ -8,6 +8,7 @@ use app\channel\service\AccountService; use app\merchant\service\MerchantService; use app\merchant\service\MerchantLogService; use app\merchant\service\OrderLastHistoryService; +use app\merchant\service\OrderLastweekHistoryService; use app\merchant\service\OrderService; use app\merchant\service\OrderHistoryService; use dever\Log; @@ -77,7 +78,7 @@ class ChannelAccountService extends Service if ($product) { $order_data = $account_data = array(); // $orderHistoryService = OrderHistoryService::instance(); - $orderHistoryService = OrderLastHistoryService::instance(); + $orderHistoryService = OrderLastweekHistoryService::instance(); $merchantLogService = MerchantLogService::instance(); $accountService = AccountService::instance(); diff --git a/app/setting/view/mobile_mnp/form.html b/app/setting/view/mobile_mnp/form.html new file mode 100644 index 0000000..333c75c --- /dev/null +++ b/app/setting/view/mobile_mnp/form.html @@ -0,0 +1,136 @@ +
+
+ +
+
+ +
+
+ +
+ +
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + +
+ + +
+ {notempty name='vo.id'}{/notempty} +
+ + +
+
+ + + + \ No newline at end of file diff --git a/app/setting/view/mobile_mnp/index.html b/app/setting/view/mobile_mnp/index.html new file mode 100644 index 0000000..dc4eb51 --- /dev/null +++ b/app/setting/view/mobile_mnp/index.html @@ -0,0 +1,111 @@ +{extend name="../../admin/view/table"} +{block name="button"} + + + +{/block} + +{block name="content"} + + + + +
+ + {include file='mobile_mnp/index_search'} +
+
+
+
+ + + + + + +{/block} + +{block name='script'} + + + +{/block} diff --git a/app/setting/view/mobile_mnp/index_search.html b/app/setting/view/mobile_mnp/index_search.html new file mode 100644 index 0000000..1843a3a --- /dev/null +++ b/app/setting/view/mobile_mnp/index_search.html @@ -0,0 +1,88 @@ +
+ {:lang('条件搜索')} + +
\ No newline at end of file diff --git a/app/task/controller/OrderTask.php b/app/task/controller/OrderTask.php index 40c1970..279d780 100644 --- a/app/task/controller/OrderTask.php +++ b/app/task/controller/OrderTask.php @@ -155,6 +155,9 @@ class OrderTask extends Core exit('ok'); } + # 商户对账 + + # 直接对数据库中的订单数据进行处理 如果队列失效,就使用这个方法进行操作,谨慎使用该方法,会和队列同时执行,已取消 /* public function runAll() diff --git a/app/task/controller/Task.php b/app/task/controller/Task.php index 81017cd..d97fadf 100644 --- a/app/task/controller/Task.php +++ b/app/task/controller/Task.php @@ -9,6 +9,7 @@ use app\gateway\service\RedisService; use app\merchant\service\MerchantLogHistoryService; use app\merchant\service\OrderHistoryService; use app\merchant\service\OrderLastHistoryService; +use app\merchant\service\OrderLastweekHistoryService; use app\merchant\service\OrderService; use app\merchant\service\RebateService; use app\setting\service\ChannelAccountService; @@ -335,8 +336,8 @@ class Task extends Core if (!$day) { $day = date('Y-m-d', strtotime('-1 day')); } -// $orderHistoryService = OrderHistoryService::instance(); - $orderHistoryService = OrderLastHistoryService::instance(); +// $orderHistoryService = OrderLastHistoryService::instance(); + $orderHistoryService = OrderLastweekHistoryService::instance(); $data = $orderHistoryService->getTotalData($day); // var_dump($data); if ($data) {