From d789a175f881b2c68ccfbdbdf1a6e8c9e209b9db Mon Sep 17 00:00:00 2001 From: liaojinling <360197197@qq.com> Date: Wed, 5 Feb 2020 18:46:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E5=B9=BF=E5=91=98/=E7=BB=84=E9=95=BF?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=A4=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Base/Service/PromoteService.class.php | 1 + .../Controller/PromoteController.class.php | 20 +++++++++++++- .../Home/Controller/QueryController.class.php | 4 ++- .../Home/View/default/Promote/addPromote.html | 27 ++++++++++++++++++- .../Home/View/default/Promote/edit_chlid.html | 17 ++++++++++++ .../Home/View/default/Query/recharge.html | 4 +-- Data/update.sql | 3 +++ 7 files changed, 71 insertions(+), 5 deletions(-) diff --git a/Application/Base/Service/PromoteService.class.php b/Application/Base/Service/PromoteService.class.php index 1361d41af..58d4d7bfc 100644 --- a/Application/Base/Service/PromoteService.class.php +++ b/Application/Base/Service/PromoteService.class.php @@ -942,6 +942,7 @@ class PromoteService { 'create_time' => time(), 'company_belong' => $params['company_belong'] ?? 0, 'company_relation' => $params['company_relation'] ?? 0, + 'group_remark' => $params['group_remark'] ?? '', ]; if ($parent) { diff --git a/Application/Home/Controller/PromoteController.class.php b/Application/Home/Controller/PromoteController.class.php index af6d64798..635d124f4 100644 --- a/Application/Home/Controller/PromoteController.class.php +++ b/Application/Home/Controller/PromoteController.class.php @@ -1088,6 +1088,7 @@ class PromoteController extends BaseController if (!$result['status']) { $this->ajaxReturn(['status' => 0, 'msg' => $result['message']]); } + $status = $promoteService->addPromote($params, $parent); if ($status) { $this->ajaxReturn(['status' => 1, 'msg' => '添加成功']); @@ -1217,7 +1218,10 @@ class PromoteController extends BaseController return false; } } - + if (empty($_REQUEST['real_name'])) { + $this->error('联系人姓名不能为空', U('Promote/edit_chlid', array('id' => $id, 'type' => I('type', 0)))); + exit(); + } if (empty($_REQUEST['real_name'])) { $this->error('联系人姓名不能为空', U('Promote/edit_chlid', array('id' => $id, 'type' => I('type', 0)))); exit(); @@ -1239,6 +1243,20 @@ class PromoteController extends BaseController $this->error('您输入的手机号码格式不合法', U('Promote/edit_chlid', array('id' => $id, 'type' => I('type', 0)))); } + $groupRemark = $_REQUEST['group_remark'] ?? ''; + $promote = M('promote', 'tab_')->field(['id', 'level'])->where(['id' => $_REQUEST['id']])->find(); + if (!$promote) { + $this->error('该推广员不存在', U('Promote/edit_chlid', array('id' => $id, 'type' => I('type', 0)))); + return false; + } + if ($promote['level'] == 2 && $groupRemark == '') { + $this->error('请输入部门名称', U('Promote/edit_chlid', array('id' => $id, 'type' => I('type', 0)))); + return false; + } + if ($promote['level'] == 3 && $groupRemark == '') { + $this->error('请输入小组名称', U('Promote/edit_chlid', array('id' => $id, 'type' => I('type', 0)))); + return false; + } // if (empty($_REQUEST['email'])) { // $this->error('电子邮箱不能为空', U('Promote/edit_chlid', array('id' => $id, 'type' => I('type', 0)))); // return false; diff --git a/Application/Home/Controller/QueryController.class.php b/Application/Home/Controller/QueryController.class.php index aa5387634..95b6063f1 100644 --- a/Application/Home/Controller/QueryController.class.php +++ b/Application/Home/Controller/QueryController.class.php @@ -146,7 +146,7 @@ class QueryController extends BaseController $promoteData = []; if (!empty($promoteIdData)) { $promoteIdData = array_unique($promoteIdData); - $promoteData = M('promote', 'tab_')->where(array('id' => ['in',$promoteIdData]))->getField('id,account,real_name'); + $promoteData = M('promote', 'tab_')->where(array('id' => ['in',$promoteIdData]))->getField('id,account,real_name,group_remark'); } foreach ($data as &$list) { switch ($list['level']) { @@ -169,8 +169,10 @@ class QueryController extends BaseController $chainArr = explode('/', $chain); $list['p_p_pro_account'] = $promoteData[$chainArr[1]]['account']; $list['p_p_pro_real_name'] = $promoteData[$chainArr[1]]['real_name']; + $list['p_p_pro_group_remark'] = $promoteData[$chainArr[1]]['group_remark']; $list['p_pro_account'] = $promoteData[$list['parent_id']]['account']; $list['p_pro_real_name'] = $promoteData[$list['parent_id']]['real_name']; + $list['p_pro_group_remark'] = $promoteData[$list['parent_id']]['group_remark']; break; } $list['user_account'] = substr($list['user_account'], 0, 2) . '******' . substr($list['user_account'], 8); diff --git a/Application/Home/View/default/Promote/addPromote.html b/Application/Home/View/default/Promote/addPromote.html index b80c232fe..d3c259252 100644 --- a/Application/Home/View/default/Promote/addPromote.html +++ b/Application/Home/View/default/Promote/addPromote.html @@ -70,10 +70,27 @@