diff --git a/Application/Admin/Controller/PartnerController.class.php b/Application/Admin/Controller/PartnerController.class.php index 81a786b1a..84224f525 100644 --- a/Application/Admin/Controller/PartnerController.class.php +++ b/Application/Admin/Controller/PartnerController.class.php @@ -211,12 +211,38 @@ class PartnerController extends ThinkController $page = $page ? $page : 1; //默认显示第一页数据 $row = intval(I('row', 0)); $row = empty($row) ? 10 : $row;//每页条数 + $p = $_REQUEST; if(!IS_ROOT){ $this->OpAuthList= getModuleControllerAuth(); } - $map = ["_string"=>"1=1"]; + $map = []; + if (!empty(I('partner_name'))) { + $map['partner_name'] = ['like', '%' . I('partner_name') . '%']; + } + if (!empty($p['verify_type'])) { + if($p['verify_type'] == 1){ + $map['partner_id'] = 0; + }else{ + $map['partner_id'] = ["neq",0]; + } + } + if (!empty($p['verify_status'])) { + $map['verify_status'] = $p['verify_status']; + } + + if (isset($_REQUEST['timestart']) && isset($_REQUEST['timeend'])) { + $time_start = strtotime($_REQUEST['timestart']); + $time_end = strtotime($_REQUEST['timeend'])+ 86399; + $map["create_time"] =['BETWEEN',[$time_start, $time_end]]; + } elseif (isset($_REQUEST['timestart'])) { + $time_start = strtotime($_REQUEST['timestart']); + $map["create_time"] =['EGT',$time_start]; + } elseif (isset($_REQUEST['timeend'])) { + $time_end = strtotime($_REQUEST['timeend'])+ 86399; + $map["create_time"] = ['ELT',$time_end]; + } $model = M("partner_verify", 'tab_'); $data = $model->where($map)->page($page,$row)->order("FIELD(verify_log,0,1,-1),create_time desc")->select(); foreach ($data as $k => &$v) { @@ -241,8 +267,8 @@ class PartnerController extends ThinkController $v['validity_time'] = $validity_start_time . '-' . $validity_end_time; $create_time = date("Y-m-d H:i:s",$v["create_time"]); - $v["create"]= "{$v['create_admin_account']}
{$create_time}"; $v['verify_log'] = json_decode($v['verify_log'], true); + $v["create"]= "{$v['verify_log']['create_user']}
{$v['verify_log']['create_time']}"; if(isset($v['verify_log']['verify_user'])){ if($v['verify_status'] == -1){ $ts = "审核拒绝"; @@ -435,12 +461,13 @@ class PartnerController extends ThinkController $ids = $_REQUEST['ids']; $dbres = M("partner_verify", 'tab_')->field("id,verify_status,verify_log")->where("id in ({$ids})")->select(); foreach($dbres as $k=>&$v){ - if($v['status'] != 0) continue; + if($v['verify_status'] != 0) continue; $v['verify_log'] = json_decode($v['verify_log'],true); $v['verify_log']['verify_user']=$this->admininfo["username"]; $v['verify_log']['verify_time']=date("Y-m-d H:i:s"); $v['verify_log'] = json_encode($v['verify_log']); $v['verify_status']=-1; + $v["create_time"]=time(); M("partner_verify", 'tab_')->save($v); addOperationLog(['op_type'=>1,'key'=>$v['id'],"op_name"=>"管理员审核",'url'=>U('index')]); } @@ -459,12 +486,13 @@ class PartnerController extends ThinkController $PartnerVerify = M("partner_verify", 'tab_'); $dbres =$PartnerVerify->field("*")->where("id in ({$ids})")->select(); foreach($dbres as $k=>&$v){ - if($v['status'] != 0) continue; + if($v['verify_status'] != 0) continue; $v['verify_log'] = json_decode($v['verify_log'],true); $v['verify_log']['verify_user']=$this->admininfo["username"]; $v['verify_log']['verify_time']=date("Y-m-d H:i:s"); $v['verify_log'] = json_encode($v['verify_log']); - $v['status']=1; + $v['verify_status']=1; + $v["create_time"]=time(); $partner_info = json_decode($v['partner_info'],true); if($v['partner_id'] == 0){ //新增 diff --git a/Application/Admin/Model/PartnerVerifyModel.class.php b/Application/Admin/Model/PartnerVerifyModel.class.php index 1020bcb47..1e66fb74d 100644 --- a/Application/Admin/Model/PartnerVerifyModel.class.php +++ b/Application/Admin/Model/PartnerVerifyModel.class.php @@ -27,9 +27,8 @@ class PartnerVerifyModel extends Model "partner_id"=>0, "partner_name"=>$partner_info['partner'], "verify_status"=>0, - "create_admin_id"=>UID, - "create_admin_account"=>$_SESSION['onethink_admin']['user_auth']['username'], - "create_time"=>time() + "create_time"=>time(), + 'verify_log'=>json_encode(["create_user"=>$_SESSION['onethink_admin']['user_auth']['username'],"create_time"=>date("Y-m-d H:i:s")]) ]; $verifydata['partner_info'] = json_encode($partner_info,JSON_UNESCAPED_UNICODE); return $this->add($verifydata); @@ -45,10 +44,8 @@ class PartnerVerifyModel extends Model "partner_id"=>$p_id, "partner_name"=>$partner_info['partner'], "verify_status"=>0, - "create_admin_id"=>UID, - "create_admin_account"=>$_SESSION['onethink_admin']['user_auth']['username'], "create_time"=>time(), - "verify_log"=>'' + 'verify_log'=>json_encode(["create_user"=>$_SESSION['onethink_admin']['user_auth']['username'],"create_time"=>date("Y-m-d H:i:s")]) ]; $verifydata['partner_info'] = json_encode($partner_info,JSON_UNESCAPED_UNICODE); diff --git a/Application/Admin/View/Partner/index.html b/Application/Admin/View/Partner/index.html index 70c80317e..89191eb54 100644 --- a/Application/Admin/View/Partner/index.html +++ b/Application/Admin/View/Partner/index.html @@ -69,11 +69,11 @@
-   +  
- @@ -82,11 +82,11 @@
+ placeholder="操作开始时间"/> -
+ placeholder="操作结束时间"/>
diff --git a/Data/update.sql b/Data/update.sql index dc818ad2e..12abda002 100644 --- a/Data/update.sql +++ b/Data/update.sql @@ -2103,9 +2103,7 @@ CREATE TABLE `tab_partner_verify` ( `partner_name` varchar(60) NOT NULL DEFAULT '' COMMENT '上游公司名称', `partner_info` text COMMENT '公司信息', `verify_status` tinyint(3) DEFAULT '0' COMMENT '状态 -1拒绝 0未审核 1审核通过', - `create_admin_id` int(11) NOT NULL DEFAULT '0' COMMENT '添加人ID', - `create_admin_account` varchar(60) COMMENT '添加人账号', - `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '添加时间', + `create_time` int(11) NOT NULL DEFAULT '0' COMMENT '操作时间', `verify_log` text COMMENT '审批相关信息json', PRIMARY KEY (`id`), KEY `partner_id` (`partner_id`) USING BTREE,