新增公司信息编辑

master
chenzhi 5 years ago
parent c708fb6d11
commit 5aa7427504

@ -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']} <br> {$create_time}";
$v['verify_log'] = json_decode($v['verify_log'], true);
$v["create"]= "{$v['verify_log']['create_user']} <br> {$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){
//新增

@ -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);

@ -69,11 +69,11 @@
</div>
<div class="input-list">
<input style="width: 200px;" type="text" name="partner" class="search-input" value="{:I('partner')}" placeholder="请输入公司名称搜索">&nbsp;
<input style="width: 200px;" type="text" name="partner_name" class="search-input" value="{:I('partner_name')}" placeholder="请输入公司名称搜索">&nbsp;
</div>
<div class="input-list input-list-game search_label_rehab">
<select id="company_type" name="verify_type" class="select_gallery" >
<select id="verify_type" name="verify_type" class="select_gallery" >
<option value="">审核类型</option>
<option value="1">新增</option>
<option value="2">修改</option>
@ -82,11 +82,11 @@
<div class="input-list">
<input type="text" id="time-start" name="timestart" class="" value="{$startDate}"
placeholder="创建开始时间"/>
placeholder="操作开始时间"/>
-
<div class="input-append date" id="datetimepicker" style="display:inline-block">
<input type="text" id="time-end" name="timeend" class="" value="{$endDate}"
placeholder="创建结束时间"/>
placeholder="操作结束时间"/>
<span class="add-on"><i class="icon-th"></i></span>
</div>
</div>

@ -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,

Loading…
Cancel
Save