You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
6565 lines
236 KiB
6565 lines
236 KiB
<?php
|
|
/**
|
|
* Created by ETEDU.
|
|
* User: Leo Chu
|
|
* Date: 2017/3/28 0028
|
|
* Time: 15:05
|
|
*/
|
|
|
|
namespace app\cult4\controller;
|
|
|
|
use app\admin\controller\Base;
|
|
use app\admin\model\Options;
|
|
use app\cult4\model\Cult4apply as ApplyModel;
|
|
use app\cult4\model\Cult4number;
|
|
use app\cult4\model\Cult4uptype as UptypeModel;
|
|
use app\cult4\model\Cult4upfiles as UpFilesModel;
|
|
use think\Db;
|
|
|
|
class Cult4 extends Base
|
|
{
|
|
/**
|
|
* 文化产业板挂牌
|
|
*/
|
|
public function cult4()
|
|
{
|
|
//主题
|
|
$tpls=Options::themes();
|
|
$this->assign('templates',$tpls);
|
|
$sys=Options::get_options('site_options',$this->lang);
|
|
$map=Options::map($this->lang);
|
|
$this->assign('map_lat',$map['map_lat']);
|
|
$this->assign('map_lng',$map['map_lng']);
|
|
$this->assign('sys',$sys);
|
|
return $this->fetch();
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
* 调用显示某个状态下文化四板申请列表
|
|
*/
|
|
public function apply_list($status,$admin_id,$status2=-1)
|
|
{
|
|
$search_name=input('search_name');
|
|
$this->assign('search_name',$search_name);
|
|
$apply_list=ApplyModel::getList($search_name,$status,$admin_id,'create_time desc,apply_id desc',$status2);
|
|
$page = $apply_list->render();
|
|
|
|
$this->assign('apply_list',$apply_list);
|
|
$this->assign('page',$page);
|
|
$this->assign('loginuser',session('admin_auth.aid'));
|
|
$this->assign('loginrole',session('admin_auth.role'));
|
|
return $this->fetch();
|
|
}
|
|
public function apply_list_Mult($status,$admin_id,$statusStr)
|
|
{
|
|
$search_name=input('search_name');
|
|
$this->assign('search_name',$search_name);
|
|
$apply_list=ApplyModel::getList2($status,$search_name,$admin_id,$statusStr);
|
|
$page = $apply_list->render();
|
|
$this->assign('apply_list',$apply_list);
|
|
$this->assign('page',$page);
|
|
$this->assign('loginuser',session('admin_auth.aid'));
|
|
return $this->fetch();
|
|
}
|
|
public function apply_list_all($admin_id)
|
|
{
|
|
$search_name=input('search_name');
|
|
$this->assign('search_name',$search_name);
|
|
$apply_list=ApplyModel::getListAll($search_name,$admin_id,'create_time desc,apply_id desc');
|
|
$page = $apply_list->render();
|
|
$this->assign('apply_list',$apply_list);
|
|
$this->assign('page',$page);
|
|
$this->assign('loginuser',session('admin_auth.aid'));
|
|
return $this->fetch();
|
|
}
|
|
/**
|
|
* 01.初审(初审中(已提交):1)
|
|
* 初审中(联席会已复议):19
|
|
*/
|
|
public function apply_list1()
|
|
{
|
|
$bAll=input('search_all',0);
|
|
$this->assign('search_all',$bAll);
|
|
if($bAll==1){
|
|
return $this->apply_list_all(session('admin_auth.aid'));
|
|
}
|
|
return $this->apply_list(1,session('admin_auth.aid'),19);
|
|
}
|
|
/**
|
|
* 02.尽职调查(尽调中(初审已通过):2)
|
|
* 尽调中(联席会已复议):36
|
|
*/
|
|
public function apply_list2()
|
|
{
|
|
$bAll=input('search_all',0);
|
|
$this->assign('search_all',$bAll);
|
|
if($bAll==1){
|
|
return $this->apply_list_all(session('admin_auth.aid'));
|
|
}
|
|
return $this->apply_list(2,session('admin_auth.aid'),36);
|
|
}
|
|
/**
|
|
* 03.复审(复审中(已尽调):5)
|
|
* 复审中(联席会已复议):20
|
|
*/
|
|
public function apply_list3()
|
|
{
|
|
$bAll=input('search_all',0);
|
|
$this->assign('search_all',$bAll);
|
|
if($bAll==1){
|
|
return $this->apply_list_all(session('admin_auth.aid'));
|
|
}
|
|
return $this->apply_list(5,session('admin_auth.aid'),20);
|
|
}
|
|
/**
|
|
* 04.风控中心审核(风控审核中(复审已通过):6)
|
|
* 风控审核中(联席会已复议):21
|
|
*/
|
|
public function apply_list4()
|
|
{
|
|
$bAll=input('search_all',0);
|
|
$this->assign('search_all',$bAll);
|
|
if($bAll==1){
|
|
return $this->apply_list_all(session('admin_auth.aid'));
|
|
}
|
|
return $this->apply_list(6,session('admin_auth.aid'),21);
|
|
}
|
|
/**
|
|
* 05.缴费
|
|
* 缴费中(风控审核通过):9
|
|
* 缴费中(联席会已复议):22
|
|
*/
|
|
public function apply_list5()
|
|
{
|
|
$bAll=input('search_all',0);
|
|
$this->assign('search_all',$bAll);
|
|
if($bAll==1){
|
|
return $this->apply_list_all(session('admin_auth.aid'));
|
|
}
|
|
return $this->apply_list_Mult(9,session('admin_auth.aid'),'9,12,22,39');
|
|
}
|
|
/**
|
|
* 06.缴费确认
|
|
* 缴费确认中(已缴费):12
|
|
* 缴费确认中(联席会已复议):39
|
|
*/
|
|
public function apply_list6()
|
|
{
|
|
$bAll=input('search_all',0);
|
|
$this->assign('search_all',$bAll);
|
|
if($bAll==1){
|
|
return $this->apply_list_all(session('admin_auth.aid'));
|
|
}
|
|
return $this->apply_list_Mult(12,session('admin_auth.aid'),'9,12,22,39');
|
|
}
|
|
/**
|
|
* 07.专家分配(专家分配中(缴费状态已确认):14)
|
|
*/
|
|
public function apply_list7()
|
|
{
|
|
$bAll=input('search_all',0);
|
|
$this->assign('search_all',$bAll);
|
|
if($bAll==1){
|
|
return $this->apply_list_all(session('admin_auth.aid'));
|
|
}
|
|
return $this->apply_list(14,session('admin_auth.aid'));
|
|
}
|
|
/**
|
|
* 07.专家分配(专家分配中(缴费状态已确认):14)
|
|
* 08.专家审核确认(专家评分中(专家已分配):15)
|
|
* 专家评分中(联席会已复议):23
|
|
*/
|
|
public function apply_list8()
|
|
{
|
|
$bAll=input('search_all',0);
|
|
$this->assign('search_all',$bAll);
|
|
if($bAll==1){
|
|
return $this->apply_list_all(session('admin_auth.aid'));
|
|
}
|
|
return $this->apply_list_Mult(15,session('admin_auth.aid'),'14,15,23');
|
|
}
|
|
/**
|
|
* 09.联席会审核(联席会审核中(已确认专家审核):16)
|
|
* 上报中(初审未通过):4
|
|
* 上报中(尽调未通过):34
|
|
* 上报中(复审未通过):8
|
|
* 上报中(风控审核未通过):11
|
|
* 上报中(未缴费未通过):13
|
|
* 上报中(专家审核未通过):17
|
|
* 上报中(材料核实未通过):28
|
|
*/
|
|
public function apply_list9()
|
|
{
|
|
$bAll=input('search_all',0);
|
|
$this->assign('search_all',$bAll);
|
|
if($bAll==1){
|
|
return $this->apply_list_all(session('admin_auth.aid'));
|
|
}
|
|
return $this->apply_list_Mult(16,session('admin_auth.aid'),'4,8,11,13,17,34,16,28');
|
|
}
|
|
/**
|
|
* 10.材料核实(材料核实中(联席会审核通过):25)
|
|
* 材料核实中(保存核实意见):47
|
|
* 材料核实中(联席会已复议):46
|
|
*/
|
|
public function apply_list10()
|
|
{
|
|
$user_id=session('admin_auth.aid');
|
|
$this->assign('user_id',$user_id);
|
|
$bAll=input('search_all',0);
|
|
$this->assign('search_all',$bAll);
|
|
if($bAll==1){
|
|
return $this->apply_list_all(session('admin_auth.aid'));
|
|
}
|
|
return $this->apply_list_Mult(25,session('admin_auth.aid'),'25,46,47');
|
|
}
|
|
/**
|
|
* 11.公告资料提交中(材料核实通过):27
|
|
* 公告资料提交中(已提交基础信息):48
|
|
* 公告资料审核中(公告资料已提交):29
|
|
*/
|
|
public function apply_list11()
|
|
{
|
|
$bAll=input('search_all',0);
|
|
$this->assign('search_all',$bAll);
|
|
if($bAll==1){
|
|
return $this->apply_list_all(session('admin_auth.aid'));
|
|
}
|
|
return $this->apply_list_Mult(48,session('admin_auth.aid'),'48,29,27');
|
|
}
|
|
/**
|
|
* 12.挂牌上市中(已提交路演资料):51
|
|
* 挂牌上市中(已提交公告资料):30
|
|
*/
|
|
public function apply_list12()
|
|
{
|
|
$bAll=input('search_all',0);
|
|
$this->assign('search_all',$bAll);
|
|
if($bAll==1){
|
|
return $this->apply_list_all(session('admin_auth.aid'));
|
|
}
|
|
return $this->apply_list_Mult(30,session('admin_auth.aid'),'30');
|
|
}
|
|
|
|
/**
|
|
* 选择特殊号码申请
|
|
*/
|
|
public function apply_list13()
|
|
{
|
|
$bAll=input('search_all',0);
|
|
$this->assign('search_all',$bAll);
|
|
if($bAll==1){
|
|
return $this->apply_list_all(session('admin_auth.aid'));
|
|
}
|
|
return $this->apply_list_Mult(48,session('admin_auth.aid'),'48');
|
|
}
|
|
|
|
/**
|
|
*号码审核18通过特殊号码审核
|
|
*/
|
|
public function apply_list14()
|
|
{
|
|
$bAll=input('search_all',0);
|
|
$this->assign('search_all',$bAll);
|
|
|
|
if($bAll==1){
|
|
return $this->apply_list_all(session('admin_auth.aid'));
|
|
}
|
|
return $this->apply_list(18,session('admin_auth.aid'),18);
|
|
}
|
|
/**
|
|
* 上市企业列表
|
|
*/
|
|
public function apply_list_final()
|
|
{
|
|
$bAll=input('search_all',0);
|
|
$this->assign('search_all',$bAll);
|
|
if($bAll==1){
|
|
return $this->apply_list_all(session('admin_auth.aid'));
|
|
}
|
|
return $this->apply_list(31,session('admin_auth.aid'),30);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
* 受理操作
|
|
*/
|
|
public function apply_applyed($process,$status)
|
|
{
|
|
if(session('admin_auth.aid')){
|
|
$apply = ApplyModel::applyed(input('apply_id'),session('admin_auth.aid'),input('seq'),$status);
|
|
|
|
if($apply==0){
|
|
$this->error('数据已更新,请重试!');
|
|
} else {
|
|
if($status==9 or $status==22)//缴费中(风控审核通过):9 缴费中(联席会已复议):22
|
|
$this->success('已受理',url('cult4/Cult4/apply_list'.$process));
|
|
elseif($status==14)//专家分配中(缴费状态已确认):14
|
|
$this->success('已受理',url('cult4/Cult4/apply_assign',array('apply_id'=>input('apply_id'))));
|
|
else
|
|
$this->success('已受理',url('cult4/Cult4/apply_check'.$process,array('apply_id'=>input('apply_id'))));
|
|
}
|
|
}
|
|
else
|
|
{
|
|
$this->error('用户ID不存在');
|
|
}
|
|
}
|
|
/**
|
|
* 01.初审受理
|
|
* 初审中(已提交):1
|
|
* 初审中(联席会已复议):19
|
|
*/
|
|
public function apply_applyed1()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==1 or $status==19)
|
|
$this->apply_applyed(1,$status);
|
|
else
|
|
$this->error('数据已更新,请重试!');
|
|
}
|
|
/**
|
|
* 02.尽职调查受理
|
|
* 尽调中(初审已通过):2
|
|
* 尽调中(联席会已复议):36
|
|
*/
|
|
public function apply_applyed2()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==2 or $status==36)
|
|
$this->apply_applyed(2,$status);
|
|
else
|
|
$this->error('数据已更新,请重试!');
|
|
}
|
|
/**
|
|
* 03.复审受理
|
|
* 复审中(已尽调):5
|
|
* 复审中(联席会已复议):20
|
|
*/
|
|
public function apply_applyed3()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==5 or $status==20)
|
|
$this->apply_applyed(3,$status);
|
|
else
|
|
$this->error('数据已更新,请重试!');
|
|
}
|
|
/**
|
|
* 04.风控受理
|
|
* 风控审核中(复审已通过):6
|
|
* 风控审核中(联席会已复议):21
|
|
*/
|
|
public function apply_applyed4()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
|
|
if($status==6 or $status==21){
|
|
$this->apply_applyed(4,$status);
|
|
}else{
|
|
$this->error('数据已更新,请重试!');
|
|
}
|
|
}
|
|
/**
|
|
* 05.缴费受理
|
|
* 缴费中(风控审核通过):9
|
|
* 缴费中(联席会已复议):22
|
|
*/
|
|
public function apply_applyed5()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==9 or $status==22)
|
|
$this->apply_applyed(5,$status);
|
|
else
|
|
$this->error('数据已更新,请重试!');
|
|
}
|
|
/**
|
|
* 06.缴费确认受理
|
|
* 缴费确认中(已缴费):12
|
|
* 缴费确认中(联席会已复议):39
|
|
*/
|
|
public function apply_applyed6()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==9 or $status==22 or $status==12 or $status==39)
|
|
$this->apply_applyed(6,$status);
|
|
else
|
|
$this->error('数据已更新,请重试!');
|
|
}
|
|
/**
|
|
* 07.专家分配受理
|
|
*/
|
|
public function apply_applyed7()
|
|
{
|
|
$this->apply_applyed(7,14);
|
|
}
|
|
/**
|
|
* 08.专家分配中(缴费状态已确认):14
|
|
* 专家评分中(专家已分配):15
|
|
* 专家评分中(联席会已复议):23
|
|
*/
|
|
public function apply_applyed8()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==14 or $status==15 or $status==23)
|
|
$this->apply_applyed(8,$status);
|
|
else
|
|
$this->error('数据已更新,请重试!');
|
|
}
|
|
/**
|
|
* 09.联席会审核中(已确认专家审核):16
|
|
*/
|
|
public function apply_applyed9()
|
|
{
|
|
//上报中(初审未通过):4
|
|
//上报中(尽调未通过):34
|
|
//上报中(复审未通过):8
|
|
//上报中(风控审核未通过):11
|
|
//上报中(未缴费未通过):13
|
|
//上报中(专家审核未通过):17
|
|
//上报中(材料核实未通过):28
|
|
//联席会审核中(已确认专家审核):16
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==4 or $status==8 or $status==11 or $status==13 or $status==17 or $status==34 or $status==16 or $status==28)
|
|
return $this->apply_applyed(9,$status);
|
|
else
|
|
return $this->apply_applyed(9,16);
|
|
}
|
|
/**
|
|
* 10.材料审核
|
|
* 材料核实中(联席会审核通过):25
|
|
* 材料核实中(联席会已复议):46
|
|
* 材料核实中(保存核实意见):47
|
|
*/
|
|
public function apply_applyed10()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==25 or $status==46 or $status==47)
|
|
$this->apply_applyed(10,$status);
|
|
else
|
|
$this->error('数据已更新,请重试!');
|
|
}
|
|
/**
|
|
* 11.公告材料审核
|
|
* 公告资料提交中(已提交基础信息):48
|
|
* 公告资料审核中(公告资料已提交):29
|
|
*/
|
|
public function apply_applyed11()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==48 or $status==29 or $status==27)
|
|
$this->apply_applyed(11,$status);
|
|
else
|
|
$this->error('数据已更新,请重试!');
|
|
}
|
|
|
|
/**
|
|
* 12.挂牌上市中
|
|
* 挂牌上市中(已提交公告资料):30
|
|
* 挂牌上市中(已提交路演资料):51
|
|
*/
|
|
public function apply_applyed12()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==51 or $status==30)
|
|
$this->apply_applyed(12,$status);
|
|
else
|
|
$this->error('数据已更新,请重试!');
|
|
}
|
|
|
|
/**
|
|
* 13.财务人员确认业务号码
|
|
*/
|
|
public function apply_applyed13()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==48)
|
|
$this->apply_applyed(13,$status);
|
|
else
|
|
$this->error('数据已更新,请重试!');
|
|
}
|
|
|
|
/**
|
|
* 13.审核号码
|
|
*/
|
|
public function apply_applyed14()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==18)
|
|
$this->apply_applyed(14,$status);
|
|
else
|
|
$this->error('数据已更新,请重试!');
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
* 审核用户信息界面
|
|
*/
|
|
public function apply_check($process,$status){
|
|
|
|
$apply_id=input('apply_id');
|
|
|
|
$user_id=session('admin_auth.aid');
|
|
$this->assign('user_id',$user_id);
|
|
//权限检查(材料核实)
|
|
if(!($process==10 and ($status==47 or $status==46 or $status==25) and get_cult4IsUserAdvicedMC($apply_id, $user_id)>0) and !($process==99)){
|
|
if (check_cult4UserRight($apply_id, $user_id, $status) == 0) {
|
|
$this->error('无权限', url('admin/Index/index'));
|
|
}
|
|
}
|
|
|
|
//取得当前审核表
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
);
|
|
$applyinfo = Db::name('cult4apply')->where($where)->find();
|
|
$this->assign('applyinfo',$applyinfo);
|
|
|
|
//取得基本信息表
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
);
|
|
$baseinfo = Db::name('cult4baseinfo')->where($where)->order('addorder desc') ->find ();
|
|
if(empty($baseinfo)){
|
|
$this->error('未录入会员基础信息表!',url('cult4/Cult4/apply_list'.$process));
|
|
}
|
|
$this->assign('baseinfo',$baseinfo);
|
|
$apply_type=$baseinfo['apply_type'];
|
|
$c_type=$baseinfo['c_type'];
|
|
$p_type=$baseinfo['p_type'];
|
|
|
|
//证件类型表
|
|
$cardtype=Db::name('cult4cardtype')->order('id')->select();
|
|
$this->assign('cardtype',$cardtype);
|
|
|
|
//项目对应列表信息
|
|
//省份表
|
|
$province = Db::name('Region')->where ( array('pid'=>1) )->select ();
|
|
$this->assign('province',$province);
|
|
//项目地址市表
|
|
$city=Db::name('Region')->where ( array('pid'=>$baseinfo['p_addr_province']) )->select ();
|
|
$this->assign('city',$city);
|
|
//项目地址区表
|
|
$town=Db::name('Region')->where ( array('pid'=>$baseinfo['p_addr_city']) )->select ();
|
|
$this->assign('town',$town);
|
|
//联系地址市表
|
|
$city2=Db::name('Region')->where ( array('pid'=>$baseinfo['p_addr2_province']) )->select ();
|
|
$this->assign('city2',$city2);
|
|
//联系地址区表
|
|
$town2=Db::name('Region')->where ( array('pid'=>$baseinfo['p_addr2_city']) )->select ();
|
|
$this->assign('town2',$town2);
|
|
//显示特殊号码
|
|
$saleno=Db::name('cult4number')->where ( array('id'=>$baseinfo['code_id']))->value ('saleno');
|
|
$this->assign('saleno',$saleno);
|
|
//取得apply_id对应的用户录入状态下的所有固定文件类型最新记录
|
|
$apply_uptypelist=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,1,0,1,'ftype_id,status,apply_id,isopen',-1);
|
|
$this->assign('apply_uptypelist',$apply_uptypelist);
|
|
|
|
//上报中(初审未通过):4
|
|
//上报中(尽调未通过):34
|
|
//上报中(复审未通过):8
|
|
//上报中(风控审核未通过):11
|
|
//上报中(未缴费未通过):13
|
|
//上报中(专家审核未通过):17
|
|
//上报中(材料核实未通过):28
|
|
//联席会审核中(已确认专家审核):16
|
|
|
|
$this->assign('status',$status);
|
|
$this->assign('apply_id',$apply_id);
|
|
|
|
//是否有联席会上报驳回意见
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
);
|
|
$jcReport = Db::name('cult4checkjc')->where($where)->order('addorder desc') ->find();
|
|
$this->assign('jcReport',$jcReport);
|
|
$this->assign('hasJcReport',0);
|
|
|
|
//初审中(已提交):1
|
|
//初审中(联席会已复议):19
|
|
if($process>=1){
|
|
//取得所有历史审核记录
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
);
|
|
$begincheck = Db::name('cult4check')->where($where)->order('addorder desc') ->select();
|
|
$this->assign('begincheck',$begincheck);
|
|
|
|
//取得apply_id对应的用户初审状态下的所有固定文件类型最新记录
|
|
$apply_uptypelist_check=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,1,array(1,19),1,'ftype_id,status,apply_id,isopen',-1);
|
|
$this->assign('apply_uptypelist_check',$apply_uptypelist_check);
|
|
|
|
//取得apply_id对应的用户初审状态下的所有补充文件类型最新记录
|
|
$apply_uptypelist_tempcheck=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,2,array(1,19),1,'ftype_id,status,apply_id,isopen',-1);
|
|
$this->assign('apply_uptypelist_tempcheck',$apply_uptypelist_tempcheck);
|
|
|
|
//初审中(联席会已复议):19
|
|
if($status==19){
|
|
$this->assign('hasJcReport',1);
|
|
}
|
|
}
|
|
|
|
//尽调中(初审已通过):2
|
|
//尽调中(联席会已复议):36
|
|
if($process>=2 and $status!=4){//$status>=2
|
|
//取得所有历史审核记录
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
);
|
|
$ddcheck = Db::name('cult4checkdd')->where($where)->order('addorder desc') ->select();
|
|
$this->assign('ddcheck',$ddcheck);
|
|
|
|
//取得apply_id对应的用户尽调状态下的所有固定文件类型最新记录
|
|
$apply_uptypelist_checkdd=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,1,array(2,36),1,'ftype_id,status,apply_id,isopen',-1);
|
|
$this->assign('apply_uptypelist_checkdd',$apply_uptypelist_checkdd);
|
|
|
|
//取得apply_id对应的用户尽调状态下的所有补充文件类型最新记录
|
|
$apply_uptypelist_tempcheckdd=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,2,array(2,36),1,'ftype_id,status,apply_id,isopen',-1);
|
|
$this->assign('apply_uptypelist_tempcheckdd',$apply_uptypelist_tempcheckdd);
|
|
|
|
//尽调中(联席会已复议):36
|
|
if($status==36){
|
|
$this->assign('hasJcReport',1);
|
|
}
|
|
}
|
|
|
|
//复审中(已尽调):5
|
|
//复审中(联席会已复议):20
|
|
if($process>=3 and $status!=4 and $status!=34){//$status>=5
|
|
//取得所有历史审核记录
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
);
|
|
$reviewcheck = Db::name('cult4checkreview')->where($where)->order('addorder desc') ->select();
|
|
$this->assign('reviewcheck',$reviewcheck);
|
|
|
|
//取得apply_id对应的用户复审状态下的所有固定文件类型最新记录
|
|
$apply_uptypelist_checkreview=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,1,array(5,20),1,'ftype_id,status,apply_id,isopen',-1);
|
|
$this->assign('apply_uptypelist_checkreview',$apply_uptypelist_checkreview);
|
|
|
|
//取得apply_id对应的用户复审状态下的所有补充文件类型最新记录
|
|
$apply_uptypelist_tempcheckreview=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,2,array(5,20),1,'ftype_id,status,apply_id,isopen',-1);
|
|
$this->assign('apply_uptypelist_tempcheckreview',$apply_uptypelist_tempcheckreview);
|
|
|
|
//复审中(联席会已复议):20
|
|
if($status==20){
|
|
$this->assign('hasJcReport',1);
|
|
}
|
|
}
|
|
|
|
//风控审核中(复审已通过):6
|
|
//风控审核中(联席会已复议):21
|
|
if($process>=4 and $status!=4 and $status!=34 and $status!=8){//$status>=6
|
|
//取得所有历史审核记录
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
);
|
|
$riskcheck = Db::name('cult4checkrisk')->where($where)->order('addorder desc') ->select();
|
|
$this->assign('riskcheck',$riskcheck);
|
|
|
|
//取得apply_id对应的用户风控审核状态下的所有固定文件类型最新记录
|
|
$apply_uptypelist_checkrisk=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,1,array(6,21),1,'ftype_id,status,apply_id,isopen',-1);
|
|
$this->assign('apply_uptypelist_checkrisk',$apply_uptypelist_checkrisk);
|
|
|
|
//取得apply_id对应的用户风控审核状态下的所有补充文件类型最新记录
|
|
$apply_uptypelist_tempcheckrisk=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,2,array(6,21),1,'ftype_id,status,apply_id,isopen',-1);
|
|
$this->assign('apply_uptypelist_tempcheckrisk',$apply_uptypelist_tempcheckrisk);
|
|
|
|
//风控审核中(联席会已复议):21
|
|
if($status==21){
|
|
$this->assign('hasJcReport',1);
|
|
}
|
|
}
|
|
//缴费中(风控审核通过):9
|
|
//缴费确认中(已缴费):12
|
|
//缴费确认中(联席会已复议):39
|
|
//缴费中(联席会已复议):22
|
|
if($process>=5 and $status!=4 and $status!=34 and $status!=8 and $status!=11){//$status>=9
|
|
//取得所有历史审核记录
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
);
|
|
$feecheck = Db::name('cult4checkfee')->where($where)->order('addorder desc') ->select();
|
|
$this->assign('feecheck',$feecheck);
|
|
|
|
//取得apply_id对应的用户缴费确认状态下的所有固定文件类型最新记录
|
|
$apply_uptypelist_checkfee=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,1,array(9,12,39,22),1,'ftype_id,status,apply_id,isopen',-1);
|
|
$this->assign('apply_uptypelist_checkfee',$apply_uptypelist_checkfee);
|
|
|
|
//取得apply_id对应的用户缴费确认状态下的所有补充文件类型最新记录
|
|
$apply_uptypelist_tempcheckfee=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,2,array(9,12,39,22),1,'ftype_id,status,apply_id,isopen',-1);
|
|
$this->assign('apply_uptypelist_tempcheckfee',$apply_uptypelist_tempcheckfee);
|
|
|
|
//缴费状态
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
'new_flag'=>1,
|
|
);
|
|
$fee_flag=Db::name('cult4fee')->where($where)->value('fee_flag');
|
|
$this->assign('fee_flag',$fee_flag);
|
|
|
|
//缴费中(联席会已复议):22
|
|
//缴费确认中(联席会已复议):39
|
|
if($status==22 || $status==39){
|
|
$this->assign('hasJcReport',1);
|
|
}
|
|
}
|
|
//专家分配中(缴费状态已确认):14
|
|
//专家评分中(专家已分配):15
|
|
//专家评分中(联席会已复议):23
|
|
if($process>=7 and $status!=4 and $status!=34 and $status!=8 and $status!=11 and $status!=13){//$status>=14
|
|
$this->assign('status',$status);
|
|
$this->assign('apply_id',$apply_id);
|
|
|
|
//专家分配
|
|
$member_list = Db::query("SELECT a.*,count(*) as CNT FROM `".config('database.prefix')."member_list` as a left join `".config('database.prefix')."cult4proassign` as b on a.member_list_id=b.user_id and (b.del_flag=0) WHERE a.member_list_groupid=3 and a.member_list_id not in(select user_id from ".config('database.prefix')."cult4proassign where del_flag=0 and apply_id=".$apply_id.") GROUP BY member_list_id order by CNT;");
|
|
$this->assign('member_list',$member_list);
|
|
|
|
//已分配专家及分配专家评分
|
|
$pro_list_assigned = Db::query("SELECT b.*,a.* FROM `".config('database.prefix')."cult4proassign` as a left join `".config('database.prefix')."member_list` as b on a.user_id=b.member_list_id WHERE a.del_flag=0 and a.apply_id=".$apply_id.";");
|
|
$this->assign('pro_list_assigned',$pro_list_assigned);
|
|
|
|
//取得所有历史审核记录
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
);
|
|
$procheck = Db::name('cult4checkpro')->where($where)->order('addorder desc') ->select();
|
|
$this->assign('procheck',$procheck);
|
|
|
|
//取得apply_id对应的专家评分中(专家已分配)状态下的所有固定文件类型最新记录
|
|
$apply_uptypelist_checkpro=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,1,array(14,15,23),1,'ftype_id,status,apply_id,isopen',-1);
|
|
$this->assign('apply_uptypelist_checkpro',$apply_uptypelist_checkpro);
|
|
|
|
//取得apply_id对应的专家评分中(专家已分配)状态下的所有补充文件类型最新记录
|
|
$apply_uptypelist_tempcheckpro=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,2,array(14,15,23),1,'ftype_id,status,apply_id,isopen',-1);
|
|
$this->assign('apply_uptypelist_tempcheckpro',$apply_uptypelist_tempcheckpro);
|
|
|
|
//专家评分中(联席会已复议):23
|
|
if($status==23){
|
|
$this->assign('hasJcReport',1);
|
|
}
|
|
}
|
|
//联席会审核中(已确认专家审核):16
|
|
//联席会审核都显示 and $status!=4 and $status!=34 and $status!=8 and $status!=11 and $status!=13 and $status!=17
|
|
if($process>=9){//$status>=16
|
|
//取得所有历史审核记录
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
);
|
|
$jccheck = Db::name('cult4checkjc')->where($where)->order('addorder desc') ->select();
|
|
$this->assign('jccheck',$jccheck);
|
|
|
|
//取得apply_id对应的用户状态下的所有固定文件类型最新记录
|
|
$apply_uptypelist_checkjc=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,1,array(4,34,8,11,13,17,16,28),1,'ftype_id,status,apply_id,isopen',-1);
|
|
$this->assign('apply_uptypelist_checkjc',$apply_uptypelist_checkjc);
|
|
|
|
//取得apply_id对应的用户状态下的所有补充文件类型最新记录
|
|
$apply_uptypelist_tempcheckjc=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,2,array(4,34,8,11,13,17,16,28),1,'ftype_id,status,apply_id,isopen',-1);
|
|
$this->assign('apply_uptypelist_tempcheckjc',$apply_uptypelist_tempcheckjc);
|
|
|
|
//查联席会决议模板
|
|
$lxhjy_tmep = Db::name('cult4upfiles')->alias("f")->join(config('database.prefix').'cult4uptype t','t.ftemp_id=f.file_id')
|
|
->where(['t.isopen'=>'1','t.status'=>30])->where('t.apply_type','in',['0',$apply_type])->order('upload_time desc')->select();
|
|
if(!empty($lxhjy_tmep)){
|
|
$this->assign('lxhjy_tmep',$lxhjy_tmep[0]);
|
|
}
|
|
}
|
|
//材料核实中(联席会审核通过):25
|
|
//材料核实中(联席会已复议):46
|
|
//材料核实中(保存核实意见):47
|
|
if($process>=10){
|
|
//取得所有历史审核记录
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
);
|
|
$mccheck = Db::name('cult4checkmc')->where($where)->order('addorder desc') ->select();
|
|
$this->assign('mccheck',$mccheck);
|
|
|
|
//取得apply_id对应的用户状态下的所有固定文件类型最新记录
|
|
$apply_uptypelist_checkmc=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,1,array(25,46,47),1,'ftype_id,status,apply_id,isopen',-1);
|
|
$this->assign('apply_uptypelist_checkmc',$apply_uptypelist_checkmc);
|
|
|
|
//取得apply_id对应的用户状态下的所有补充文件类型最新记录
|
|
$apply_uptypelist_tempcheckmc=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,2,array(25,46,47),1,'ftype_id,status,apply_id,isopen',-1);
|
|
$this->assign('apply_uptypelist_tempcheckmc',$apply_uptypelist_tempcheckmc);
|
|
|
|
//材料核实中(联席会已复议):46
|
|
if($status==46){
|
|
$this->assign('hasJcReport',1);
|
|
}
|
|
$apply_lxhjy = Db::name('cult4upfiles')->where(['apply_id'=>$apply_id,'status'=>16])->order('upload_time desc')->find();
|
|
$this->assign('apply_lxhjy',$apply_lxhjy);
|
|
}
|
|
//公告资料提交中(已提交基础信息):48
|
|
//公告资料审核中(公告资料已提交):29
|
|
if($process>=11){
|
|
//取得所有历史审核记录
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
);
|
|
$nmcheck = Db::name('cult4checknm')->where($where)->order('addorder desc') ->select();
|
|
$this->assign('nmcheck',$nmcheck);
|
|
|
|
//取得apply_id对应的用户状态下的所有固定文件类型最新记录
|
|
$apply_uptypelist_checknm=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,1,array(48,29,27),1,'ftype_id,status,apply_id,isopen',-1);
|
|
$this->assign('apply_uptypelist_checknm',$apply_uptypelist_checknm);
|
|
|
|
//取得apply_id对应的用户状态下的所有补充文件类型最新记录
|
|
$apply_uptypelist_tempchecknm=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,2,array(48,29,27),1,'ftype_id,status,apply_id,isopen',-1);
|
|
$this->assign('apply_uptypelist_tempchecknm',$apply_uptypelist_tempchecknm);
|
|
|
|
//取得对应的特殊号段
|
|
if($status==27){
|
|
$where=array(
|
|
'status' => 1,
|
|
'salestatus' => 0,
|
|
);
|
|
}elseif($status==48 or $status==29){
|
|
$where=array(
|
|
'status' => 1,
|
|
);
|
|
}else{
|
|
$where=array(
|
|
'status' => 1,
|
|
);
|
|
}
|
|
$salenolist = Db::name('cult4number')->where($where)->select();
|
|
$this->assign('salenolist',$salenolist);
|
|
}
|
|
//挂牌上市中(已提交公告资料):30
|
|
//挂牌上市中(已提交路演资料):51
|
|
if($process>=12){
|
|
//取得所有历史审核记录
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
);
|
|
$boardcheck = Db::name('cult4checkboard')->where($where)->order('addorder desc') ->select();
|
|
$this->assign('boardcheck',$boardcheck);
|
|
|
|
//取得apply_id对应的用户状态下的所有固定文件类型最新记录
|
|
$apply_uptypelist_checkboard=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,1,array(51,30),1,'ftype_id,status,apply_id,isopen',-1);
|
|
$this->assign('apply_uptypelist_checkboard',$apply_uptypelist_checkboard);
|
|
|
|
//取得apply_id对应的用户状态下的所有补充文件类型最新记录
|
|
$apply_uptypelist_tempcheckboard=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,2,array(51,30),1,'ftype_id,status,apply_id,isopen',-1);
|
|
$this->assign('apply_uptypelist_tempcheckboard',$apply_uptypelist_tempcheckboard);
|
|
}
|
|
return $this->fetch();
|
|
}
|
|
/**
|
|
* 01.初审中(已提交):1
|
|
* 初审中(联席会已复议):19
|
|
*/
|
|
public function apply_check1()
|
|
{
|
|
//创建token
|
|
creatToken();
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==1 or $status==19)
|
|
return $this->apply_check(1,$status);
|
|
else
|
|
return $this->apply_check(1,1);
|
|
}
|
|
/**
|
|
* 02.尽调中(初审已通过):2
|
|
* 尽调中(联席会已复议):36
|
|
*/
|
|
public function apply_check2()
|
|
{
|
|
//创建token
|
|
creatToken();
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==2 or $status==36)
|
|
return $this->apply_check(2,$status);
|
|
else
|
|
return $this->apply_check(2,2);
|
|
}
|
|
/**
|
|
* 03.复审中(已尽调):5
|
|
* 复审中(联席会已复议):20
|
|
*/
|
|
public function apply_check3()
|
|
{
|
|
//创建token
|
|
creatToken();
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==5 or $status==20)
|
|
return $this->apply_check(3,$status);
|
|
else
|
|
return $this->apply_check(3,5);
|
|
}
|
|
/**
|
|
* 04.风控审核中(复审已通过):6
|
|
* 风控审核中(联席会已复议):21
|
|
*/
|
|
public function apply_check4()
|
|
{
|
|
//创建token
|
|
creatToken();
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==6 or $status==21)
|
|
return $this->apply_check(4,$status);
|
|
else
|
|
return $this->apply_check(4,6);
|
|
}
|
|
/**
|
|
* 06.缴费确认审核
|
|
* 缴费中(风控审核通过):9
|
|
* 缴费确认中(已缴费):12
|
|
* 缴费中(联席会已复议):22
|
|
* 缴费确认中(联席会已复议):39
|
|
*/
|
|
public function apply_check6()
|
|
{
|
|
//创建token
|
|
creatToken();
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==9 or $status==12 or $status==22 or $status==39)
|
|
return $this->apply_check(6,$status);
|
|
else
|
|
return $this->apply_check(6,12);
|
|
}
|
|
/**
|
|
* 07.专家分配
|
|
* 专家分配中(缴费状态已确认):14
|
|
* 专家评分中(专家已分配):15
|
|
* 专家评分中(联席会已复议):23
|
|
*/
|
|
public function apply_assign()
|
|
{
|
|
//创建token
|
|
creatToken();
|
|
|
|
$apply_id=input('apply_id');
|
|
//权限检查
|
|
if( (check_cult4UserRight($apply_id,session('admin_auth.aid'),14)==0) and (check_cult4UserRight($apply_id,session('admin_auth.aid'),15)==0) and (check_cult4UserRight($apply_id,session('admin_auth.aid'),23)==0) ){
|
|
$this->error('无权限',url('admin/Index/index'));
|
|
}
|
|
|
|
$this->assign('apply_id',$apply_id);
|
|
|
|
$member_list = Db::query("SELECT a.*,count(*) as CNT FROM `wjs_member_list` as a left join `wjs_cult4proassign` as b on a.member_list_id=b.user_id and (b.del_flag=0) WHERE a.member_list_groupid=3 and a.member_list_id not in(select user_id from wjs_cult4proassign where del_flag=0 and apply_id=".$apply_id.") GROUP BY member_list_id order by CNT;");
|
|
$this->assign('member_list',$member_list);
|
|
|
|
$member_list_assigned = Db::query("SELECT b.*,a.pro_id FROM `wjs_cult4proassign` as a left join `wjs_member_list` as b on a.user_id=b.member_list_id WHERE a.del_flag=0 and a.apply_id=".$apply_id.";");
|
|
$this->assign('member_list_assigned',$member_list_assigned);
|
|
|
|
$p=input('p');
|
|
if(request()->isAjax()){
|
|
if($p==1)
|
|
return $this->fetch('ajax_apply_listadd');
|
|
else
|
|
return $this->fetch('ajax_apply_listdel');
|
|
}else{
|
|
return $this->fetch();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 08.专家评分中(专家已分配):15
|
|
* 专家分配中(缴费状态已确认):14
|
|
* 专家评分中(专家已分配):15
|
|
* 专家评分中(联席会已复议):23
|
|
*/
|
|
public function apply_check8()
|
|
{
|
|
//创建token
|
|
creatToken();
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==14 or $status==15 or $status==23)
|
|
return $this->apply_check(8,$status);
|
|
else
|
|
return $this->apply_check(8,15);
|
|
}
|
|
/**
|
|
* 09.联席会审核
|
|
*/
|
|
public function apply_check9()
|
|
{
|
|
//创建token
|
|
creatToken();
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
|
|
//上报中(初审未通过):4
|
|
//上报中(尽调未通过):34
|
|
//上报中(复审未通过):8
|
|
//上报中(风控审核未通过):11
|
|
//上报中(未缴费未通过):13
|
|
//上报中(专家审核未通过):17
|
|
//上报中(材料核实未通过):28
|
|
//联席会审核中(已确认专家审核):16
|
|
if($status==4 or $status==8 or $status==11 or $status==13 or $status==17 or $status==34 or $status==16 or $status==28)
|
|
return $this->apply_check(9,$status);
|
|
else
|
|
return $this->apply_check(9,16);
|
|
}
|
|
/**
|
|
* 10.材料核实中(联席会审核通过):25
|
|
*/
|
|
public function apply_check10()
|
|
{
|
|
//创建token
|
|
creatToken();
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
|
|
//材料核实中(联席会审核通过):25
|
|
//材料核实中(联席会已复议):46
|
|
//材料核实中(保存核实意见):47
|
|
if($status==25 or $status==46 or $status==47)
|
|
return $this->apply_check(10,$status);
|
|
else
|
|
return $this->apply_check(10,25);
|
|
}
|
|
/**
|
|
* 11.公告资料提交中(已提交基础信息):48
|
|
*/
|
|
public function apply_check11()
|
|
{
|
|
//创建token
|
|
creatToken();
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
|
|
//公告资料提交中(材料核实通过):48
|
|
//公告资料审核中(公告资料已提交):29
|
|
//公告资料提交中(材料核实通过):27
|
|
if($status==48 or $status==29 or $status==27)
|
|
return $this->apply_check(11,$status);
|
|
else
|
|
return $this->apply_check(11,48);
|
|
}
|
|
|
|
/**
|
|
* 12.挂牌上市中(已提交公告资料):30
|
|
* 挂牌上市中(已提交路演资料):51
|
|
*/
|
|
public function apply_check12()
|
|
{
|
|
//创建token
|
|
creatToken();
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
//挂牌上市中(已提交公告资料):30
|
|
//挂牌上市中(已提交路演资料):51
|
|
if($status==51 or $status==30 or $status==48 or $status==55)
|
|
return $this->apply_check(12,$status);
|
|
else
|
|
return $this->apply_check(12,51);
|
|
}
|
|
|
|
/**
|
|
* 13.财务人员确认业务号码
|
|
*/
|
|
public function apply_check13()
|
|
{
|
|
//创建token
|
|
creatToken();
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
|
|
if($status==48)
|
|
return $this->apply_check(13,$status);
|
|
else
|
|
return $this->apply_check(13,48);
|
|
}
|
|
|
|
/**
|
|
* 14号码审核
|
|
*/
|
|
public function apply_check14()
|
|
{
|
|
//创建token
|
|
creatToken();
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
|
|
if($status==18)
|
|
return $this->apply_check(14,$status);
|
|
else
|
|
return $this->apply_check(14,18);
|
|
}
|
|
/**
|
|
* 查看
|
|
* 13.挂牌上市成功:31
|
|
*/
|
|
public function apply_check_final()
|
|
{
|
|
//创建token
|
|
creatToken();
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
|
|
if($status==31)
|
|
return $this->apply_check(99,$status);
|
|
else
|
|
return $this->apply_check(99,31);
|
|
}
|
|
/**
|
|
* 编辑
|
|
* 13.挂牌上市成功:31
|
|
*/
|
|
public function apply_check_final_edit()
|
|
{
|
|
//创建token
|
|
creatToken();
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
|
|
if($status==31)
|
|
return $this->apply_check(99,$status);
|
|
else
|
|
return $this->apply_check(99,31);
|
|
}
|
|
/**
|
|
* 07.专家分配添加
|
|
* 08.专家分配添加
|
|
* @param $assign_type 0:专家分配角色 1:确认专家审核角色(前台专家不可见)
|
|
*/
|
|
public function apply_assign_add($assign_type=0){
|
|
$p=input('p');
|
|
$apply_id=input('apply_id');
|
|
$member_list_id=input('id');
|
|
$user_id=session('admin_auth.aid');
|
|
|
|
//检查是否超出限额
|
|
$whereCnt['apply_id']=array('eq', $apply_id);
|
|
$whereCnt['del_flag']=array('eq', 0);
|
|
$assignCnt = Db()->name('cult4proassign')->where($whereCnt)->count();
|
|
if($assignCnt>=config('cult4ProLimit')){
|
|
$this->error('专家分配已超出限额!最多分配'.config('cult4ProLimit').'名专家',url('cult4/Cult4/apply_assign',array('apply_id'=>$apply_id,'p'=>$p)));
|
|
}
|
|
|
|
$sl_data=array(
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$member_list_id,
|
|
'assign_type'=>$assign_type,
|
|
'del_flag'=>0,
|
|
'score'=>0,
|
|
'full_score'=>config('cult4ProScore'),
|
|
'create_id'=>$user_id,
|
|
'create_time'=>time(),
|
|
);
|
|
$rst=Db::name('cult4proassign')->insert($sl_data);
|
|
if($rst!==false){
|
|
if($assign_type==0){
|
|
$this->success('专家分配成功',url('cult4/Cult4/apply_assign',array('apply_id'=>$apply_id,'p'=>$p)));//专家分配
|
|
}elseif($assign_type==1){
|
|
//专家审核确认
|
|
$this->success('专家分配成功',url('cult4/Cult4/apply_check8#pro',array('apply_id'=>$apply_id,'snd'=>rand(10000,99999))));
|
|
}
|
|
}else{
|
|
if($assign_type==0)
|
|
$this->error('专家分配失败',url('cult4/Cult4/apply_assign',array('apply_id'=>$apply_id,'p'=>$p)));//专家分配
|
|
elseif($assign_type==1)
|
|
$this->error('专家分配失败',url('cult4/Cult4/apply_check8#pro',array('apply_id'=>$apply_id,'snd'=>rand(10000,99999))));//专家审核确认
|
|
}
|
|
}
|
|
/**
|
|
* 07.专家分配删除
|
|
* 08.专家分配删除
|
|
*/
|
|
public function apply_assign_del($assign_type=0){
|
|
$p=input('p');
|
|
$pro_id=input('id');
|
|
$apply_id=input('apply_id');
|
|
|
|
$where=array(
|
|
'pro_id'=>$pro_id,
|
|
);
|
|
$sl_data=array(
|
|
'del_flag'=>1,
|
|
);
|
|
$rst=Db::name('cult4proassign')->where($where)->update($sl_data);
|
|
if($rst!==false){
|
|
if($assign_type==0)
|
|
$this->success('已分配专家删除成功',url('cult4/Cult4/apply_assign',array('apply_id'=>$apply_id,'p'=>$p)));//专家分配
|
|
elseif($assign_type==1)
|
|
$this->success('已分配专家删除成功',url('cult4/Cult4/apply_check8#pro',array('apply_id'=>$apply_id,'snd'=>rand(10000,99999))));//专家审核确认
|
|
}else{
|
|
if($assign_type==0)
|
|
$this->error('已分配专家删除失败',url('cult4/Cult4/apply_assign',array('apply_id'=>$apply_id,'p'=>$p)));//专家分配
|
|
elseif($assign_type==1)
|
|
$this->error('已分配专家删除失败',url('cult4/Cult4/apply_check8#pro',array('apply_id'=>$apply_id,'snd'=>rand(10000,99999))));//专家审核确认
|
|
}
|
|
}
|
|
/**
|
|
* 07.专家分配完成
|
|
* 08.专家分配完成
|
|
*/
|
|
public function apply_assign_finish(){
|
|
//本处理对应状态
|
|
$chkStatus = 14;
|
|
$apply_id=input('apply_id');
|
|
$user_id=session('admin_auth.aid');
|
|
$submitType=input('submitType');
|
|
//下面相关业务代码
|
|
if($submitType==1) {
|
|
//$this->redirect(url('cult4/Cult4/apply_list7'));
|
|
$this->success('返回成功!',url('cult4/Cult4/apply_list7'));
|
|
}elseif($submitType==2 or $submitType==3) {//分配完成
|
|
//统一推送消息
|
|
$user_ids=Db::name('cult4proassign')->where(['apply_id'=>$apply_id,'del_flag'=>0])->order('pro_id desc')->column('user_id');
|
|
if($user_ids){
|
|
/**
|
|
* 增加通知推送,by rainfer
|
|
*/
|
|
$baseinfo=Db::name('cult4baseinfo')->where(['apply_id'=>$apply_id,'new_flag'=>1])->find();
|
|
if($baseinfo['apply_type']==1){
|
|
$baseinfo_name=$baseinfo['c_name'];
|
|
}elseif ($baseinfo['apply_type']==2){
|
|
$baseinfo_name=$baseinfo['p_name'];
|
|
}else{
|
|
$baseinfo_name=$baseinfo['t_apply_username'];
|
|
}
|
|
foreach($user_ids as $v){
|
|
$notice_title='【'.$baseinfo_name.'】挂牌申请的专家评审分配给您!';
|
|
$notice='【'.$baseinfo_name.'】挂牌申请的专家评审分配给您,请您评审,请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_procheck',['apply_id'=>$apply_id]).'">专家评审</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'user_id'=>$v,
|
|
'apply_id'=>$apply_id,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
}
|
|
}else{
|
|
$this->error('请先至少分配1名专家!');
|
|
}
|
|
|
|
//专家评分中(专家已分配):15
|
|
//更新主表cult4apply
|
|
$sl_data3['apply_id']=$apply_id;
|
|
$sl_data3['status']=15;
|
|
$sl_data3['update_user_id']=$user_id;
|
|
$sl_data3['update_user_type']=2;//后台
|
|
$sl_data3['update_time']=time();
|
|
if($submitType==2)
|
|
$sl_data3['apply_admin_id']=0;//初始化受理状态
|
|
$where3=array(
|
|
'apply_id'=>$apply_id,
|
|
'status'=>$chkStatus,
|
|
);
|
|
Db::name('cult4apply')->where($where3)->update($sl_data3);
|
|
if($submitType==2){
|
|
//$this->redirect(url('cult4/Cult4/apply_list7'));//专家分配
|
|
$this->success('专家分配成功!',url('cult4/Cult4/apply_list7'));
|
|
}
|
|
elseif($submitType==3)
|
|
{
|
|
//$this->redirect(url('cult4/Cult4/apply_check8#pro',array('apply_id'=>$apply_id,'snd'=>rand(10000,99999))));//专家审核确认
|
|
$this->success('专家分配成功!',url('cult4/Cult4/apply_check8#pro',array('apply_id'=>$apply_id,'snd'=>rand(10000,99999))));
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* 08.专家分配添加
|
|
*/
|
|
public function apply_assign_add2(){
|
|
$this->apply_assign_add(1);
|
|
}
|
|
/**
|
|
* 08.专家分配删除
|
|
*/
|
|
public function apply_assign_del2(){
|
|
$this->apply_assign_del(1);
|
|
}
|
|
/**
|
|
* 08.专家分配评分
|
|
*/
|
|
public function apply_score()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$user_id=session('admin_auth.aid');
|
|
$pro_id=input('pro_id');
|
|
|
|
$advice=input('myEditorPro'.$pro_id);
|
|
if($advice=='')
|
|
{
|
|
$this->error('请输入专家评分意见!',url('cult4/Cult4/apply_check8#pro',array('apply_id'=>$apply_id,'snd'=>rand(10000,99999))));
|
|
}
|
|
|
|
$score=input('score'.$pro_id);
|
|
if($score<=0){
|
|
$this->error('请录入评分!',url('cult4/Cult4/apply_check8#pro',array('apply_id'=>$apply_id,'snd'=>rand(10000,99999))));
|
|
}
|
|
|
|
//更新评分表cult4apply
|
|
$sl_data['score']=$score;
|
|
$sl_data['advice']=$advice;
|
|
$sl_data['assign_type']=1;//前台不可见
|
|
$sl_data['update_id']=$user_id;
|
|
$sl_data['update_type']=2;//后台
|
|
$sl_data['update_time']=time();
|
|
$where=array(
|
|
'pro_id'=>$pro_id,
|
|
);
|
|
Db::name('cult4proassign')->where($where)->update($sl_data);
|
|
$this->success('评分成功',url('cult4/Cult4/apply_check8#pro',array('apply_id'=>$apply_id,'snd'=>rand(10000,99999))));//专家评分确认
|
|
}
|
|
/**
|
|
* 文化四板文件核验开启/禁止
|
|
*/
|
|
public function apply_state($process,$status)
|
|
{
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
$this->error('用户ID不存在');
|
|
}
|
|
|
|
$apply_id=get_cult4ApplyIDFromFileID($id);
|
|
|
|
//权限检查
|
|
if (check_cult4UserRight($apply_id, session('admin_auth.aid'), $status) == 0) {
|
|
$this->error('无权限',url('admin/Index/index'));
|
|
}
|
|
$flag=Db::name('cult4upfiles')->where('file_id',$id)->value('flag');//判断当前状态情况
|
|
if($flag==1){
|
|
$flagdata = array('flag'=>0);
|
|
Db::name('cult4upfiles')->where('file_id',$id)->setField($flagdata);
|
|
$this->success('审核未通过');
|
|
}else{
|
|
$flagdata = array('flag'=>1);
|
|
Db::name('cult4upfiles')->where('file_id',$id)->setField($flagdata);
|
|
$this->success('审核已通过');
|
|
}
|
|
}
|
|
/**
|
|
* 初审
|
|
* 初审中(已提交):1
|
|
* 初审中(联席会已复议):19
|
|
*/
|
|
public function apply_state1()
|
|
{
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
$this->error('文件ID不存在');
|
|
}
|
|
$apply_id=get_cult4ApplyIDFromFileID($id);
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
|
|
if($status==1 or $status==19)
|
|
$this->apply_state(1,$status);
|
|
else
|
|
$this->apply_state(1,1);
|
|
}
|
|
/**
|
|
* 尽职调查
|
|
* 尽调中(初审已通过):2
|
|
* 尽调中(联席会已复议):36
|
|
*/
|
|
public function apply_state2()
|
|
{
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
$this->error('文件ID不存在');
|
|
}
|
|
$apply_id=get_cult4ApplyIDFromFileID($id);
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
|
|
if($status==2 or $status==36)
|
|
$this->apply_state(2,$status);
|
|
else
|
|
$this->apply_state(2,2);
|
|
}
|
|
/**
|
|
* 复审
|
|
* 复审中(已尽调):5
|
|
* 复审中(联席会已复议):20
|
|
*/
|
|
public function apply_state3()
|
|
{
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
$this->error('文件ID不存在');
|
|
}
|
|
$apply_id=get_cult4ApplyIDFromFileID($id);
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
|
|
if($status==5 or $status==20)
|
|
$this->apply_state(3,$status);
|
|
else
|
|
$this->apply_state(3,5);
|
|
}
|
|
/**
|
|
* 风控审核
|
|
* 风控审核中(复审已通过):6
|
|
* 风控审核中(联席会已复议):21
|
|
*/
|
|
public function apply_state4()
|
|
{
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
$this->error('文件ID不存在');
|
|
}
|
|
$apply_id=get_cult4ApplyIDFromFileID($id);
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
|
|
if($status==6 or $status==21)
|
|
$this->apply_state(4,$status);
|
|
else
|
|
$this->apply_state(4,6);
|
|
}
|
|
/**
|
|
* 缴费确认审核
|
|
*/
|
|
public function apply_state6()
|
|
{
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
$this->error('文件ID不存在');
|
|
}
|
|
$apply_id=get_cult4ApplyIDFromFileID($id);
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
|
|
if($status==9 or $status==12)
|
|
$this->apply_state(6,$status);
|
|
else
|
|
$this->apply_state(6,12);
|
|
}
|
|
/**
|
|
* 专家审核确认
|
|
*/
|
|
public function apply_state8()
|
|
{
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
$this->error('文件ID不存在');
|
|
}
|
|
$apply_id=get_cult4ApplyIDFromFileID($id);
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
|
|
if($status==14 or $status==15)
|
|
$this->apply_state(8,$status);
|
|
else
|
|
$this->apply_state(8,15);
|
|
}
|
|
/**
|
|
* 联席会审核
|
|
*/
|
|
public function apply_state9()
|
|
{
|
|
//上报中(初审未通过):4
|
|
//上报中(尽调未通过):34
|
|
//上报中(复审未通过):8
|
|
//上报中(风控审核未通过):11
|
|
//上报中(未缴费未通过):13
|
|
//上报中(专家审核未通过):17
|
|
//上报中(材料核实未通过):28
|
|
//联席会审核中(已确认专家审核):16
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
$this->error('用户ID不存在');
|
|
}
|
|
$apply_id=get_cult4ApplyIDFromFileID($id);
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
|
|
if($status==4 or $status==8 or $status==11 or $status==13 or $status==17 or $status==34 or $status==16 or $status==28)
|
|
$this->apply_state(9,$status);
|
|
else
|
|
$this->apply_state(9,16);
|
|
}
|
|
/**
|
|
* 材料核实中(联席会审核通过):25
|
|
* 材料核实中(联席会已复议):46
|
|
* 材料核实中(保存核实意见):47
|
|
*/
|
|
public function apply_state10()
|
|
{
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
$this->error('文件ID不存在');
|
|
}
|
|
$apply_id=get_cult4ApplyIDFromFileID($id);
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
|
|
if($status==25 or $status==46 or $status==47)
|
|
$this->apply_state(10,$status);
|
|
else
|
|
$this->apply_state(10,25);
|
|
}
|
|
/**
|
|
* 公告资料提交中(已提交基础信息):48
|
|
* 公告资料审核中(公告资料已提交):29
|
|
* 公告资料提交中(材料核实通过):27
|
|
*/
|
|
public function apply_state11()
|
|
{
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
$this->error('文件ID不存在');
|
|
}
|
|
$apply_id=get_cult4ApplyIDFromFileID($id);
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
|
|
if($status==48 or $status==29 or $status==27)
|
|
$this->apply_state(11,$status);
|
|
else
|
|
$this->apply_state(11,48);
|
|
}
|
|
|
|
/**
|
|
* 挂牌上市中(已提交公告资料):30
|
|
* 挂牌上市中(已提交路演资料):51
|
|
*/
|
|
public function apply_state12()
|
|
{
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
$this->error('文件ID不存在');
|
|
}
|
|
$apply_id=get_cult4ApplyIDFromFileID($id);
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
|
|
if($status==51 or $status==30)
|
|
$this->apply_state(12,$status);
|
|
else
|
|
$this->apply_state(12,51);
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
* 调用显示某个状态下文化四板文件类型列表
|
|
* @param int $ftype 查询条件(-1:包括临时和固定 1:固定 2:临时)
|
|
* @param int $status 后台查询的操作用户状态
|
|
* @return 对应文件类型列表
|
|
*/
|
|
public function uptype_list($process=-1,$status=-1,$ftype=1)
|
|
{
|
|
$apply_id=input('apply_id');
|
|
//添加固定内容
|
|
if (!($ftype == 1 and $status ==-1)) {
|
|
//权限检查
|
|
if (check_cult4UserRight($apply_id, session('admin_auth.aid'), $status) == 0) {
|
|
$this->error('无权限',url('admin/Index/index'));
|
|
}
|
|
}
|
|
$whereType=array(
|
|
'apply_id'=>$apply_id,
|
|
'new_flag'=>1,
|
|
);
|
|
$apply_type=Db::name('cult4baseinfo')->where($whereType)->value('apply_type');
|
|
$c_type=Db::name('cult4baseinfo')->where($whereType)->value('c_type');
|
|
$p_type=Db::name('cult4baseinfo')->where($whereType)->value('p_type');
|
|
if($status==-1){
|
|
//固定类型input('apply_id')==null
|
|
$uptype_list=UptypeModel::getList(-1,$c_type,$p_type,0,$ftype,$status,-1,'status,apply_type,ftype_id',-1);
|
|
$page = $uptype_list->render();
|
|
$this->assign('uptype_list',$uptype_list);
|
|
$this->assign('page',$page);
|
|
}else{
|
|
//临时类型
|
|
$uptype_list=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,$ftype,$status,-1);
|
|
$this->assign('uptype_list',$uptype_list);
|
|
|
|
$this->assign('apply_id',$apply_id);
|
|
$this->assign('status',$status);
|
|
}
|
|
return $this->fetch();
|
|
}
|
|
/**
|
|
* 01.初审(初审中(已提交):1)
|
|
*/
|
|
public function uptype_list1()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==1 or $status==19)
|
|
return $this->uptype_list(1,$status,2);
|
|
else
|
|
return $this->uptype_list(1,1,2);
|
|
}
|
|
/**
|
|
* 02.尽调中(初审已通过):2)
|
|
*/
|
|
public function uptype_list2()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==2 or $status==36)
|
|
return $this->uptype_list(2,$status,2);
|
|
else
|
|
return $this->uptype_list(2,2,2);
|
|
}
|
|
/**
|
|
* 03.复审中(已尽调):5)
|
|
*/
|
|
public function uptype_list3()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==5 or $status==20)
|
|
return $this->uptype_list(3,$status,2);
|
|
else
|
|
return $this->uptype_list(3,5,2);
|
|
}
|
|
/**
|
|
* 04.风控审核中(复审已通过):6)
|
|
*/
|
|
public function uptype_list4()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==6 or $status==21)
|
|
return $this->uptype_list(4,$status,2);
|
|
else
|
|
return $this->uptype_list(4,6,2);
|
|
}
|
|
/**
|
|
* 06.缴费确认中(已缴费):12
|
|
*/
|
|
public function uptype_list6()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==9 or $status==12)
|
|
return $this->uptype_list(6,$status,2);
|
|
else
|
|
return $this->uptype_list(6,12,2);
|
|
}
|
|
/**
|
|
* 08.专家评分中(专家已分配):15
|
|
*/
|
|
public function uptype_list8()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==14 or $status==15)
|
|
return $this->uptype_list(8,$status,2);
|
|
else
|
|
return $this->uptype_list(8,15,2);
|
|
}
|
|
/**
|
|
* 09.联席会审核中(已确认专家审核):16
|
|
*/
|
|
public function uptype_list9()
|
|
{
|
|
//上报中(初审未通过):4
|
|
//上报中(尽调未通过):34
|
|
//上报中(复审未通过):8
|
|
//上报中(风控审核未通过):11
|
|
//上报中(未缴费未通过):13
|
|
//上报中(专家审核未通过):17
|
|
//上报中(材料核实未通过):28
|
|
//联席会审核中(已确认专家审核):16
|
|
$apply_id=input('apply_id');
|
|
$this->assign('apply_id',$apply_id);
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
|
|
//权限检查
|
|
if(!in_array($status,[4,34,8,11,13,17,16,28])){
|
|
$this->error('无权限',url('admin/Index/index'));
|
|
}
|
|
if (check_cult4UserRight(input('apply_id'), session('admin_auth.aid'), $status) == 0) {
|
|
$this->error('无权限',url('admin/Index/index'));
|
|
}
|
|
|
|
$whereType=array(
|
|
'apply_id'=>$apply_id,
|
|
'new_flag'=>1,
|
|
);
|
|
$apply_type=Db::name('cult4baseinfo')->where($whereType)->value('apply_type');
|
|
$c_type=Db::name('cult4baseinfo')->where($whereType)->value('c_type');
|
|
|
|
//临时类型
|
|
$where=array();
|
|
$where['apply_id'] = array('eq', $apply_id);
|
|
$where['status'] = array('in','4,34,8,11,13,17,16,28');
|
|
$where['apply_type'] = $apply_type;
|
|
if($apply_type==1){
|
|
if(($c_type==1 or $c_type==3))
|
|
$where['c_type']=array('in','0,'.$c_type);
|
|
else
|
|
$where['c_type']=0;
|
|
}
|
|
$where['isopen'] = 1;
|
|
$order='ftype_id,status,apply_id,isopen';
|
|
$uptype_list=Db::name('cult4uptype')->where($where)->order($order)->select();
|
|
$this->assign('uptype_list',$uptype_list);
|
|
|
|
$this->assign('status',$status);
|
|
return $this->fetch();
|
|
}
|
|
/**
|
|
* 10.材料核实中(联席会审核通过):25
|
|
* 材料核实中(联席会已复议):46
|
|
* 材料核实中(保存核实意见):47
|
|
*/
|
|
public function uptype_list10()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==25 or $status==46 or $status==47)
|
|
return $this->uptype_list(10,$status,2);
|
|
else
|
|
return $this->uptype_list(10,25,2);
|
|
}
|
|
/**
|
|
* 11.公告资料提交中(已提交基础信息):48
|
|
* 公告资料审核中(公告资料已提交):29
|
|
* 公告资料提交中(材料核实通过):27
|
|
*/
|
|
public function uptype_list11()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==48 or $status==29 or $status==27)
|
|
return $this->uptype_list(11,$status,2);
|
|
else
|
|
return $this->uptype_list(11,48,2);
|
|
}
|
|
/**
|
|
* 12.挂牌上市中(已提交公告资料):30
|
|
* 挂牌上市中(已提交路演资料):51
|
|
*/
|
|
public function uptype_list12()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==48 or $status==30)
|
|
return $this->uptype_list(12,$status,2);
|
|
else
|
|
return $this->uptype_list(12,48,2);
|
|
}
|
|
|
|
/**
|
|
* 文化四板文件类型添加
|
|
*/
|
|
public function uptype_add($process=-1,$status=-1)
|
|
{
|
|
if ($process > 0 and $status > 0) {
|
|
//权限检查
|
|
if (check_cult4UserRight(input('apply_id'), session('admin_auth.aid'), $status) == 0) {
|
|
$this->error('无权限',url('admin/Index/index'));
|
|
}
|
|
}
|
|
//创建token
|
|
creatToken();
|
|
|
|
$apply_id=input('apply_id');
|
|
$this->assign('apply_id',$apply_id);
|
|
$this->assign('status',$status);
|
|
$where['status'] = array('egt',0);
|
|
$statuslist=Db::name('cult4status')->where($where)->select();
|
|
$this->assign('statuslist',$statuslist);
|
|
|
|
return $this->fetch();
|
|
}
|
|
|
|
/**
|
|
* 文化四板文件类型添加:初审
|
|
* 初审中(已提交):1
|
|
* 初审中(联席会已复议):19
|
|
*/
|
|
public function uptype_add1(){
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==1 or $status==19)
|
|
return $this->uptype_add(1,$status);
|
|
else
|
|
return $this->uptype_add(1,1);
|
|
}
|
|
/**
|
|
* 文化四板文件类型添加:尽职调查
|
|
* 尽调中(初审已通过):2
|
|
* 尽调中(联席会已复议):36
|
|
*/
|
|
public function uptype_add2(){
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==2 or $status==36)
|
|
return $this->uptype_add(2,$status);
|
|
else
|
|
return $this->uptype_add(2,2);
|
|
}
|
|
/**
|
|
* 文化四板文件类型添加:复审
|
|
* 复审中(已尽调):5
|
|
* 复审中(联席会已复议):20
|
|
*/
|
|
public function uptype_add3(){
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==5 or $status==20)
|
|
return $this->uptype_add(3,$status);
|
|
else
|
|
return $this->uptype_add(3,5);
|
|
}
|
|
/**
|
|
* 文化四板文件类型添加:风控
|
|
* 风控审核中(复审已通过):6
|
|
* 风控审核中(联席会已复议):21
|
|
*/
|
|
public function uptype_add4(){
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==6 or $status==21)
|
|
return $this->uptype_add(4,$status);
|
|
else
|
|
return $this->uptype_add(4,6);
|
|
}
|
|
/**
|
|
* 文化四板文件类型添加:缴费确认
|
|
* 缴费中(联席会已复议):22
|
|
* 缴费确认中(联席会已复议):39
|
|
*/
|
|
public function uptype_add6(){
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==9 or $status==12 or $status==22 or $status==39)
|
|
return $this->uptype_add(6,$status);
|
|
else
|
|
return $this->uptype_add(6,12);
|
|
}
|
|
/**
|
|
* 文化四板文件类型添加:专家审核确认
|
|
* 专家评分中(联席会已复议):23
|
|
*/
|
|
public function uptype_add8(){
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==14 or $status==15 or $status==23)
|
|
return $this->uptype_add(8,$status);
|
|
else
|
|
return $this->uptype_add(8,15);
|
|
}
|
|
/**
|
|
* 文化四板文件类型添加:联席会
|
|
*/
|
|
public function uptype_add9(){
|
|
//上报中(初审未通过):4
|
|
//上报中(尽调未通过):34
|
|
//上报中(复审未通过):8
|
|
//上报中(风控审核未通过):11
|
|
//上报中(未缴费未通过):13
|
|
//上报中(专家审核未通过):17
|
|
//上报中(材料核实未通过):28
|
|
//联席会审核中(已确认专家审核):16
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==4 or $status==8 or $status==11 or $status==13 or $status==17 or $status==34 or $status==16 or $status==28)
|
|
return $this->uptype_add(9,$status);
|
|
else
|
|
return $this->uptype_add(9,16);
|
|
}
|
|
/**
|
|
* 文化四板文件类型添加:材料核实
|
|
*/
|
|
public function uptype_add10(){
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==25 or $status==46 or $status==47)
|
|
return $this->uptype_add(10,$status);
|
|
else
|
|
return $this->uptype_add(10,25);
|
|
}
|
|
/**
|
|
* 文化四板文件类型添加:公告材料核实
|
|
*/
|
|
public function uptype_add11(){
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==48 or $status==29 or $status==27)
|
|
return $this->uptype_add(11,$status);
|
|
else
|
|
return $this->uptype_add(11,48);
|
|
}
|
|
|
|
/**
|
|
* 文化四板文件类型添加:挂牌审核
|
|
*/
|
|
public function uptype_add12(){
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==51 or $status==30)
|
|
return $this->uptype_add(12,$status);
|
|
else
|
|
return $this->uptype_add(12,51);
|
|
}
|
|
/**
|
|
* 文化四板固定文件类型修改
|
|
*/
|
|
public function uptype_edit(){
|
|
if(!request()->isAjax()) {
|
|
//创建token
|
|
creatToken();
|
|
|
|
$ftype_id = input('ftype_id', 0, 'intval');
|
|
if (!$ftype_id) $this->error('参数错误', url('cult4/Cult4/uptype_list'));
|
|
$uptype = Db::name('cult4uptype')->where('ftype_id', $ftype_id)->find();
|
|
$this->assign('uptype', $uptype);
|
|
|
|
$where['status'] = array('egt',0);
|
|
$statuslist=Db::name('cult4status')->where($where)->select();
|
|
$this->assign('statuslist',$statuslist);
|
|
|
|
$list1=array();
|
|
if($uptype['upload_role_type']==1){
|
|
$map1['member_group_id']=array(array('gt',0),array('neq',2));//>0 and !=2
|
|
$list1=Db::name("member_group")->field(array('member_group_id'=>'id','member_group_name'=>'name'))->where($map1)->select();
|
|
}elseif($uptype['upload_role_type']==2){
|
|
$map2['id']=array('gt',0);
|
|
$list1=Db::name("auth_group")->field(array('id'=>'id','title'=>'name'))->where($map2)->select();
|
|
}
|
|
$this->assign('list1',$list1);
|
|
$list2=array();
|
|
if($uptype['upload_role_type2']==1){
|
|
$map1['member_group_id']=array(array('gt',0),array('neq',2));//>0 and !=2
|
|
$list2=Db::name("member_group")->field(array('member_group_id'=>'id','member_group_name'=>'name'))->where($map1)->select();
|
|
}elseif($uptype['upload_role_type2']==2){
|
|
$map2['id']=array('gt',0);
|
|
$list2=Db::name("auth_group")->field(array('id'=>'id','title'=>'name'))->where($map2)->select();
|
|
}
|
|
$this->assign('list2',$list2);
|
|
return $this->fetch();
|
|
}else{
|
|
$roletype=input('roletype');
|
|
$roleid=input('roletitle');
|
|
$roletype2=input('roletype2');
|
|
$roleid2=input('roletitle2');
|
|
if($roletype<=0 or $roleid<=0)
|
|
{
|
|
$this->error('请选择资料上传类型及对应的角色!');
|
|
}
|
|
if(empty($roletype2))$roletype2=0;
|
|
if(empty($roleid2))$roleid2=0;
|
|
if(!(($roletype2==0 and $roleid2==0) or ($roletype2>0 and $roleid2>0) or ($roletype2<=0 and $roleid2<=0)))
|
|
{
|
|
$this->error('请选择资料辅助上传类型及对应的角色!');
|
|
}
|
|
//防止重复提交
|
|
if (!checkToken(input('TOKEN'))) {
|
|
return;
|
|
}
|
|
|
|
//固定
|
|
$apply_id = 0;
|
|
$apply_type=input('apply_type');
|
|
$gp_level=input('gp_level');
|
|
$c_type=input('c_type');
|
|
$p_type=input('p_type');
|
|
$mustupload=input('mustupload');
|
|
|
|
//上传模板部分
|
|
$file_id=0;
|
|
//支持多个字段单文件
|
|
$file = request()->file('file_one');
|
|
$file_one='';
|
|
|
|
if(!empty($file)){
|
|
$validate = config('upload_validate');
|
|
unset($validate['ext']);//不限制后缀
|
|
//单图
|
|
$info = $file->validate($validate)->rule('uniqid')->move(ROOT_PATH . config('upload_path') . DS . date('Y-m-d'));
|
|
|
|
if ($info) {
|
|
$file_url = config('upload_path'). '/' . date('Y-m-d') . '/' . $info->getFilename();
|
|
//写入数据库
|
|
$data['apply_id'] = 0;//模板文件未使用该字段
|
|
$data['user_id'] = session('admin_auth.aid');
|
|
$data['user_type'] = 2;
|
|
$data['status'] = input('status');
|
|
$data['upload_time'] = time();
|
|
$data['ftype_id'] = 0;//模板文件为0
|
|
$data['ftype'] = 3;//模板类型
|
|
$data['filesize'] = $info->getSize();
|
|
$data['path'] = $file_url;
|
|
$data['addorder'] = 0;//固定文件需要更新
|
|
$data['new_flag'] = 1;//固定文件需要更新
|
|
|
|
$file_id = Db::name('cult4upfiles')->insert($data,false,true);
|
|
|
|
} else {
|
|
$this->error($file->getError());//否则就是上传错误,显示错误原因
|
|
}
|
|
}else{
|
|
$file_id = input('ftemp_id');
|
|
$data['file_id'] = $file_id;//模板文件未使用该字段
|
|
$data['status'] = input('status');
|
|
Db::name('cult4upfiles')->where('file_id',$file_id)->update($data);
|
|
}
|
|
$sl_data=array(
|
|
'ftype_id'=>input('ftype_id'),
|
|
'ftypedescr'=>input('ftypedescr'),
|
|
'ftemp_id' => $file_id,
|
|
'gp_level' => $gp_level,
|
|
'apply_type' => $apply_type,
|
|
'c_type' => $c_type,
|
|
'p_type' => $p_type,
|
|
'mustupload' => $mustupload,
|
|
'ftype'=>input('ftype'),
|
|
'status'=>input('status'),
|
|
'isopen'=>input('isopen',0),
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>session('admin_auth.aid'),
|
|
'create_time'=>time(),
|
|
'upload_role_type'=>$roletype,
|
|
'upload_role_id'=>$roleid,
|
|
'upload_role_type2'=>$roletype2,
|
|
'upload_role_id2'=>$roleid2,
|
|
);
|
|
$uptype_id=Db::name('cult4uptype')->where('ftype_id',input('ftype_id'))->update($sl_data);
|
|
if($uptype_id){
|
|
$this->success('文件类型修改成功',url('cult4/Cult4/uptype_list'));
|
|
}else{
|
|
$this->error('文件类型修改失败');
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
* 文化四板文件类型添加操作
|
|
*/
|
|
public function uptype_runadd($process=-1,$status=-1)
|
|
{
|
|
//添加固定内容
|
|
if (!($process == -1 or $status ==-1)) {
|
|
//权限检查
|
|
if (check_cult4UserRight(input('apply_id'), session('admin_auth.aid'), $status) == 0) {
|
|
$this->error('无权限',url('admin/Index/index'));
|
|
}
|
|
}
|
|
|
|
$roletype=input('roletype');
|
|
$roleid=input('roletitle');
|
|
$roletype2=input('roletype2');
|
|
$roleid2=input('roletitle2');
|
|
if($roletype<=0 or $roleid<=0)
|
|
{
|
|
$this->error('请选择资料上传类型及对应的角色!');
|
|
}
|
|
if(empty($roletype2))$roletype2=0;
|
|
if(empty($roleid2))$roleid2=0;
|
|
if(!(($roletype2==0 and $roleid2==0) or ($roletype2>0 and $roleid2>0) or ($roletype2<=0 and $roleid2<=0)))
|
|
{
|
|
$this->error('请选择资料辅助上传类型及对应的角色!');
|
|
}
|
|
//防止重复提交
|
|
if (!checkToken(input('TOKEN'))) {
|
|
//return;
|
|
}
|
|
|
|
//状态为-1时对应固定文件
|
|
$apply_id=input('apply_id');
|
|
$whereType=array(
|
|
'apply_id'=>$apply_id,
|
|
'new_flag'=>1,
|
|
);
|
|
$apply_type=Db::name('cult4baseinfo')->where($whereType)->value('apply_type');
|
|
$c_type=Db::name('cult4baseinfo')->where($whereType)->value('c_type');
|
|
$p_type=Db::name('cult4baseinfo')->where($whereType)->value('p_type');
|
|
$mustupload=1;
|
|
if($process==-1){
|
|
$apply_id = 0;
|
|
$apply_type=input('apply_type');
|
|
$c_type=input('c_type');
|
|
$p_type=input('p_type');
|
|
$mustupload=input('mustupload');
|
|
}
|
|
|
|
//上传模板部分
|
|
$file_id=0;
|
|
//支持多个字段单文件
|
|
$file = request()->file('file_one');
|
|
$file_one='';
|
|
|
|
if(!empty($file)){
|
|
$validate = config('upload_validate');
|
|
unset($validate['ext']);//不限制后缀
|
|
//单图
|
|
$info = $file->validate($validate)->rule('uniqid')->move(ROOT_PATH . config('upload_path') . DS . date('Y-m-d'));
|
|
|
|
if ($info) {
|
|
$file_url = config('upload_path'). '/' . date('Y-m-d') . '/' . $info->getFilename();
|
|
//写入数据库
|
|
$data['apply_id'] = 0;//模板文件未使用该字段
|
|
$data['user_id'] = session('admin_auth.aid');
|
|
$data['user_type'] = 2;
|
|
$data['status'] = $status;
|
|
$data['upload_time'] = time();
|
|
$data['ftype_id'] = 0;//模板文件为0
|
|
$data['ftype'] = 3;//模板类型
|
|
$data['filesize'] = $info->getSize();
|
|
$data['path'] = $file_url;
|
|
$data['addorder'] = 0;//固定文件需要更新
|
|
$data['new_flag'] = 1;//固定文件需要更新
|
|
|
|
$file_id = Db::name('cult4upfiles')->insert($data,false,true);
|
|
|
|
} else {
|
|
$this->error($file->getError());//否则就是上传错误,显示错误原因
|
|
}
|
|
}
|
|
if ($process == -1 or $status ==-1) {
|
|
$uptype_id=UptypeModel::add(input('gp_level'),$apply_type,$c_type,$p_type,input('ftypedescr'),$file_id,input('ftype'),input('status'),input('isopen',0),0,session('admin_auth.aid'),$roletype,$roleid,$roletype2,$roleid2,$mustupload);
|
|
if($uptype_id){
|
|
$this->success('文件类型添加成功',url('cult4/Cult4/uptype_list'));
|
|
}else{
|
|
$this->error('文件类型添加失败');
|
|
}
|
|
}else{
|
|
$uptype_id=UptypeModel::add(input('gp_level'),$apply_type,$c_type,$p_type,input('ftypedescr'),$file_id,input('ftype'),$status,input('isopen',0),$apply_id,session('admin_auth.aid'),$roletype,$roleid,$roletype2,$roleid2);
|
|
if($uptype_id){
|
|
$sl_data2['apply_id']=input('apply_id');
|
|
$sl_data2['status']=$status;
|
|
$this->success('文件类型添加成功',url('cult4/Cult4/uptype_list'.$process,$sl_data2));
|
|
}else{
|
|
$this->error('文件类型添加失败');
|
|
}
|
|
}
|
|
}
|
|
/**
|
|
* 文化四板文件类型添加操作:初审
|
|
* 初审中(已提交):1
|
|
* 初审中(联席会已复议):19
|
|
*/
|
|
public function uptype_runadd1(){
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==1 or $status==19)
|
|
$this->uptype_runadd(1,$status);
|
|
else
|
|
$this->uptype_runadd(1,1);
|
|
}
|
|
/**
|
|
* 文化四板文件类型添加操作:尽职调查
|
|
* 尽调中(初审已通过):2
|
|
* 尽调中(联席会已复议):36
|
|
*/
|
|
public function uptype_runadd2(){
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==2 or $status==36)
|
|
$this->uptype_runadd(2,$status);
|
|
else
|
|
$this->uptype_runadd(2,2);
|
|
}
|
|
/**
|
|
* 文化四板文件类型添加操作:复审
|
|
* 复审中(已尽调):5
|
|
* 复审中(联席会已复议):20
|
|
*/
|
|
public function uptype_runadd3(){
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==5 or $status==20)
|
|
$this->uptype_runadd(3,$status);
|
|
else
|
|
$this->uptype_runadd(3,5);
|
|
}
|
|
/**
|
|
* 文化四板文件类型添加操作:风控
|
|
* 风控审核中(复审已通过):6
|
|
* 风控审核中(联席会已复议):21
|
|
*/
|
|
public function uptype_runadd4(){
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==6 or $status==21)
|
|
$this->uptype_runadd(4,$status);
|
|
else
|
|
$this->uptype_runadd(4,6);
|
|
}
|
|
/**
|
|
* 文化四板文件类型添加操作:缴费确认
|
|
* 缴费中(联席会已复议):22
|
|
* 缴费确认中(联席会已复议):39
|
|
*/
|
|
public function uptype_runadd6(){
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==9 or $status==12 or $status==22 or $status==39)
|
|
$this->uptype_runadd(6,$status);
|
|
else
|
|
$this->uptype_runadd(6,12);
|
|
}
|
|
/**
|
|
* 文化四板文件类型添加操作:专家审核确认
|
|
* 专家评分中(联席会已复议):23
|
|
*/
|
|
public function uptype_runadd8(){
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==14 or $status==15 or $status==23)
|
|
$this->uptype_runadd(8,$status);
|
|
else
|
|
$this->uptype_runadd(8,15);
|
|
}
|
|
/**
|
|
* 文化四板文件类型添加操作:联席会
|
|
*/
|
|
public function uptype_runadd9(){
|
|
//上报中(初审未通过):4
|
|
//上报中(尽调未通过):34
|
|
//上报中(复审未通过):8
|
|
//上报中(风控审核未通过):11
|
|
//上报中(未缴费未通过):13
|
|
//上报中(专家审核未通过):17
|
|
//上报中(材料核实未通过):28
|
|
//联席会审核中(已确认专家审核):16
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==4 or $status==8 or $status==11 or $status==13 or $status==17 or $status==34 or $status==16 or $status==28)
|
|
$this->uptype_runadd(9,$status);
|
|
else
|
|
$this->uptype_runadd(9,16);
|
|
}
|
|
/**
|
|
* 文化四板文件类型添加操作:材料审核
|
|
*/
|
|
public function uptype_runadd10(){
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==25 or $status==46 or $status==47)
|
|
$this->uptype_runadd(10,$status);
|
|
else
|
|
$this->uptype_runadd(10,25);
|
|
}
|
|
/**
|
|
* 文化四板文件类型添加操作:公告材料审核
|
|
*/
|
|
public function uptype_runadd11(){
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==48 or $status==29 or $status==27)
|
|
$this->uptype_runadd(11,$status);
|
|
else
|
|
$this->uptype_runadd(11,48);
|
|
}
|
|
|
|
/**
|
|
* 文化四板文件类型添加操作:挂牌上市审核
|
|
*/
|
|
public function uptype_runadd12(){
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==51 or $status==30)
|
|
$this->uptype_runadd(12,$status);
|
|
else
|
|
$this->uptype_runadd(12,51);
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
* 文化四板文件类型列表开启/禁止
|
|
*/
|
|
public function uptype_state($process=-1,$status=-1)
|
|
{
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
//如果不是固定添加类型
|
|
if (!($process == -1 or $status ==-1)) {
|
|
$this->error('文件ID不存在', url('cult4/Cult4/uptype_list' . $process));
|
|
}else{
|
|
$this->error('文件ID不存在', url('cult4/Cult4/uptype_list'));
|
|
}
|
|
}
|
|
|
|
//取得apply_id
|
|
$apply_id=get_cult4ApplyIDFromTempID($id);
|
|
if($apply_id==-1){
|
|
$this->error('无权限',url('admin/Index/index'));
|
|
}
|
|
|
|
//如果不是固定添加类型
|
|
if (!($process == -1 or $status ==-1 or $apply_id==0)) {
|
|
//权限检查
|
|
if (check_cult4UserRight($apply_id, session('admin_auth.aid'), $status) == 0) {
|
|
$this->error('无权限',url('admin/Index/index'));
|
|
}
|
|
}
|
|
|
|
$isopen=Db::name('cult4uptype')->where('ftype_id',$id)->value('isopen');//判断当前状态情况
|
|
if($isopen==1){
|
|
$statedata = array('isopen'=>0);
|
|
Db::name('cult4uptype')->where('ftype_id',$id)->setField($statedata);
|
|
$this->success('状态禁止');
|
|
}else{
|
|
$statedata = array('isopen'=>1);
|
|
Db::name('cult4uptype')->where('ftype_id',$id)->setField($statedata);
|
|
$this->success('状态开启');
|
|
}
|
|
}
|
|
/**
|
|
* 文化四板文件类型列表开启/禁止 初审
|
|
* 初审中(已提交):1
|
|
* 初审中(联席会已复议):19
|
|
*/
|
|
public function uptype_state1()
|
|
{
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
//如果不是固定添加类型
|
|
$this->error('文件ID不存在', url('cult4/Cult4/uptype_list1'));
|
|
}
|
|
|
|
//取得apply_id
|
|
$apply_id=get_cult4ApplyIDFromTempID($id);
|
|
if($apply_id==-1){
|
|
$this->error('无权限',url('admin/Index/index'));
|
|
}
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==1 or $status==19)
|
|
$this->uptype_state(1,$status);
|
|
else
|
|
$this->uptype_state(1,1);
|
|
}
|
|
/**
|
|
* 文化四板文件类型列表开启/禁止 尽职调查
|
|
* 尽调中(初审已通过):2
|
|
* 尽调中(联席会已复议):36
|
|
*/
|
|
public function uptype_state2()
|
|
{
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
//如果不是固定添加类型
|
|
$this->error('文件ID不存在', url('cult4/Cult4/uptype_list2'));
|
|
}
|
|
|
|
//取得apply_id
|
|
$apply_id=get_cult4ApplyIDFromTempID($id);
|
|
if($apply_id==-1){
|
|
$this->error('无权限',url('admin/Index/index'));
|
|
}
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==2 or $status==36)
|
|
$this->uptype_state(2,$status);
|
|
else
|
|
$this->uptype_state(2,2);
|
|
}
|
|
/**
|
|
* 文化四板文件类型列表开启/禁止 复审
|
|
* 复审中(已尽调):5
|
|
* 复审中(联席会已复议):20
|
|
*/
|
|
public function uptype_state3()
|
|
{
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
//如果不是固定添加类型
|
|
$this->error('文件ID不存在', url('cult4/Cult4/uptype_list3'));
|
|
}
|
|
|
|
//取得apply_id
|
|
$apply_id=get_cult4ApplyIDFromTempID($id);
|
|
if($apply_id==-1){
|
|
$this->error('无权限',url('admin/Index/index'));
|
|
}
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==5 or $status==20)
|
|
$this->uptype_state(3,$status);
|
|
else
|
|
$this->uptype_state(3,5);
|
|
}
|
|
/**
|
|
* 文化四板文件类型列表开启/禁止 风控
|
|
* 风控审核中(复审已通过):6
|
|
* 风控审核中(联席会已复议):21
|
|
*/
|
|
public function uptype_state4()
|
|
{
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
//如果不是固定添加类型
|
|
$this->error('文件ID不存在', url('cult4/Cult4/uptype_list6'));
|
|
}
|
|
|
|
//取得apply_id
|
|
$apply_id=get_cult4ApplyIDFromTempID($id);
|
|
if($apply_id==-1){
|
|
$this->error('无权限',url('admin/Index/index'));
|
|
}
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==6 or $status==21)
|
|
$this->uptype_state(4,$status);
|
|
else
|
|
$this->uptype_state(4,6);
|
|
}
|
|
/**
|
|
* 文化四板文件类型列表开启/禁止 缴费确认
|
|
* 缴费中(联席会已复议):22
|
|
* 缴费确认中(联席会已复议):39
|
|
*/
|
|
public function uptype_state6()
|
|
{
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
//如果不是固定添加类型
|
|
$this->error('文件ID不存在', url('cult4/Cult4/uptype_list6'));
|
|
}
|
|
|
|
//取得apply_id
|
|
$apply_id=get_cult4ApplyIDFromTempID($id);
|
|
if($apply_id==-1){
|
|
$this->error('无权限',url('admin/Index/index'));
|
|
}
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==12 or $status==39)// or $status==22
|
|
$this->uptype_state(6,$status);
|
|
else
|
|
$this->uptype_state(6,12);
|
|
}
|
|
/**
|
|
* 文化四板文件类型列表开启/禁止 专家审核确认
|
|
* 专家评分中(联席会已复议):23
|
|
*/
|
|
public function uptype_state8()
|
|
{
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
//如果不是固定添加类型
|
|
$this->error('文件ID不存在', url('cult4/Cult4/uptype_list8'));
|
|
}
|
|
|
|
//取得apply_id
|
|
$apply_id=get_cult4ApplyIDFromTempID($id);
|
|
if($apply_id==-1){
|
|
$this->error('无权限',url('admin/Index/index'));
|
|
}
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==14 or $status==15 or $status==23)
|
|
$this->uptype_state(8,$status);
|
|
else
|
|
$this->uptype_state(8,15);
|
|
}
|
|
/**
|
|
* 文化四板文件类型列表开启/禁止 联席会
|
|
*/
|
|
public function uptype_state9()
|
|
{
|
|
//上报中(初审未通过):4
|
|
//上报中(尽调未通过):34
|
|
//上报中(复审未通过):8
|
|
//上报中(风控审核未通过):11
|
|
//上报中(未缴费未通过):13
|
|
//上报中(专家审核未通过):17
|
|
//上报中(材料核实未通过):28
|
|
//联席会审核中(已确认专家审核):16
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
$this->error('文件ID不存在', url('cult4/Cult4/uptype_list9'));
|
|
}
|
|
|
|
//取得apply_id
|
|
$apply_id=get_cult4ApplyIDFromTempID($id);
|
|
if($apply_id==-1){
|
|
$this->error('无权限',url('admin/Index/index'));
|
|
}
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
|
|
if($status==4 or $status==8 or $status==11 or $status==13 or $status==17 or $status==34 or $status==16 or $status==28)
|
|
$this->uptype_state(9,$status);
|
|
else
|
|
$this->uptype_state(9,16);
|
|
}
|
|
/**
|
|
* 文化四板文件类型列表开启/禁止 材料审核
|
|
*/
|
|
public function uptype_state10()
|
|
{
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
//如果不是固定添加类型
|
|
$this->error('文件ID不存在', url('cult4/Cult4/uptype_list8'));
|
|
}
|
|
|
|
//取得apply_id
|
|
$apply_id=get_cult4ApplyIDFromTempID($id);
|
|
if($apply_id==-1){
|
|
$this->error('无权限',url('admin/Index/index'));
|
|
}
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==25 or $status==46 or $status==47)
|
|
$this->uptype_state(10,$status);
|
|
else
|
|
$this->uptype_state(10,25);
|
|
}
|
|
/**
|
|
* 文化四板文件类型列表开启/禁止 公告材料审核
|
|
*/
|
|
public function uptype_state11()
|
|
{
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
//如果不是固定添加类型
|
|
$this->error('文件ID不存在', url('cult4/Cult4/uptype_list8'));
|
|
}
|
|
|
|
//取得apply_id
|
|
$apply_id=get_cult4ApplyIDFromTempID($id);
|
|
if($apply_id==-1){
|
|
$this->error('无权限',url('admin/Index/index'));
|
|
}
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==48 or $status==29 or $status==27)
|
|
$this->uptype_state(11,$status);
|
|
else
|
|
$this->uptype_state(11,48);
|
|
}
|
|
|
|
/**
|
|
* 文化四板文件类型列表开启/禁止 挂牌上市审核
|
|
*/
|
|
public function uptype_state12()
|
|
{
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
//如果不是固定添加类型
|
|
$this->error('文件ID不存在', url('cult4/Cult4/uptype_list8'));
|
|
}
|
|
|
|
//取得apply_id
|
|
$apply_id=get_cult4ApplyIDFromTempID($id);
|
|
if($apply_id==-1){
|
|
$this->error('无权限',url('admin/Index/index'));
|
|
}
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==51 or $status==30)
|
|
$this->uptype_state(12,$status);
|
|
else
|
|
$this->uptype_state(12,51);
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
* 后台上传操作
|
|
*/
|
|
public function apply_runupload($process,$status){
|
|
$apply_id=input('apply_id');
|
|
$user_id=session('admin_auth.aid');
|
|
|
|
//当前后台用户对应的组
|
|
$group=Db::name('auth_group_access')->where('uid',$user_id)->find();
|
|
$groupid=0;
|
|
if(!(empty($group))){
|
|
$groupid=$group['group_id'];
|
|
}
|
|
|
|
//上传资料列表提交
|
|
//取得apply_id对应的用户对应状态下的所有固定文件类型最新记录
|
|
$whereType=array(
|
|
'apply_id'=>$apply_id,
|
|
'new_flag'=>1,
|
|
);
|
|
$apply_type=Db::name('cult4baseinfo')->where($whereType)->value('apply_type');
|
|
if($process>0)$apply_type=-1;
|
|
$c_type=Db::name('cult4baseinfo')->where($whereType)->value('c_type');
|
|
$p_type=Db::name('cult4baseinfo')->where($whereType)->value('p_type');
|
|
$apply_uptypelist_checkdd=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,1,$status,1);
|
|
foreach($apply_uptypelist_checkdd as $k=>$v){
|
|
//如果后台有上传权限($groupid==1超级管理员可以上传)
|
|
if($groupid==1 or (($v['upload_role_type']==2) and ($v['upload_role_id']==$groupid) ) or (($v['upload_role_type2']==2) and ($v['upload_role_id2']==$groupid)) ){
|
|
//找到当前最大addorder
|
|
$addorder=0;
|
|
$where4=array(
|
|
'apply_id'=>$apply_id,
|
|
'ftype_id'=>$v['ftype_id'],
|
|
'ftype'=>1,//固定
|
|
'flag'=>0,//未审核
|
|
);
|
|
$check=Db::name('cult4upfiles')->where($where4)->order('addorder desc') ->find ();
|
|
if(!empty($check)){
|
|
$addorder = $check['addorder'] + 1;
|
|
}
|
|
//上传资料部分
|
|
$file_id=0;
|
|
//支持多个字段单文件
|
|
$file = request()->file('file'.$v['ftype_id']);
|
|
$file_one='';
|
|
|
|
if(!empty($file)){
|
|
//更新所有历史记录new_flag为0
|
|
Db::name('cult4upfiles')->where($where4)->update(['new_flag'=>0]);
|
|
|
|
$validate = config('upload_validate');
|
|
unset($validate['ext']);//不限制后缀
|
|
//单图
|
|
$info = $file->validate($validate)->rule('uniqid')->move(ROOT_PATH . config('upload_path') . DS . date('Y-m-d'));
|
|
|
|
if ($info) {
|
|
$file_url = config('upload_path'). '/' . date('Y-m-d') . '/' . $info->getFilename();
|
|
//写入数据库
|
|
$data['apply_id'] = $apply_id;
|
|
$data['user_id'] = $user_id;
|
|
$data['user_type'] = 2;//后台
|
|
$data['status'] = $status;
|
|
$data['upload_time'] = time();
|
|
$data['ftype_id'] = $v['ftype_id'];
|
|
$data['ftype'] = 1;//固定
|
|
$data['filesize'] = $info->getSize();
|
|
$data['path'] = $file_url;
|
|
$data['addorder'] = $addorder;
|
|
$data['new_flag'] = 1;//最新
|
|
$data['flag'] = 1;//后台审核完上传,无需再审
|
|
|
|
$file_id = Db::name('cult4upfiles')->insert($data,false,true);
|
|
} else {
|
|
$this->error($file->getError());//否则就是上传错误,显示错误原因
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
//取得apply_id对应的用户对应状态下的所有补充文件类型最新记录
|
|
$apply_uptypelist_tempcheckdd=UptypeModel::getList($apply_type,$c_type,$p_type,$apply_id,2,$status,1);
|
|
foreach($apply_uptypelist_tempcheckdd as $k=>$v){
|
|
//如果后台有上传权限
|
|
if($groupid==1 or (($v['upload_role_type']==2) and ($v['upload_role_id']==$groupid) ) or (($v['upload_role_type2']==2) and ($v['upload_role_id2']==$groupid)) ){
|
|
//找到当前最大addorder
|
|
$addorder=0;
|
|
$where5=array(
|
|
'apply_id'=>$apply_id,
|
|
'ftype_id'=>$v['ftype_id'],
|
|
'ftype'=>2,//临时
|
|
'flag'=>0,//未审核
|
|
);
|
|
$check=Db::name('cult4upfiles')->where($where5)->order('addorder desc') ->find ();
|
|
if(!empty($check)){
|
|
$addorder = $check['addorder'] + 1;
|
|
}
|
|
//上传资料部分
|
|
$file_id=0;
|
|
//支持多个字段单文件
|
|
$file = request()->file('file'.$v['ftype_id']);
|
|
$file_one='';
|
|
|
|
if(!empty($file)){
|
|
//更新所有历史记录new_flag为0
|
|
Db::name('cult4upfiles')->where($where5)->update(['new_flag'=>0]);
|
|
|
|
$validate = config('upload_validate');
|
|
unset($validate['ext']);//不限制后缀
|
|
//单图
|
|
$info = $file->validate($validate)->rule('uniqid')->move(ROOT_PATH . config('upload_path') . DS . date('Y-m-d'));
|
|
|
|
if ($info) {
|
|
$file_url = config('upload_path'). '/' . date('Y-m-d') . '/' . $info->getFilename();
|
|
//写入数据库
|
|
$data['apply_id'] = $apply_id;
|
|
$data['user_id'] = $user_id;
|
|
$data['user_type'] = 2;//后台
|
|
$data['status'] = $status;
|
|
$data['upload_time'] = time();
|
|
$data['ftype_id'] = $v['ftype_id'];
|
|
$data['ftype'] = 2;//临时
|
|
$data['filesize'] = $info->getSize();
|
|
$data['path'] = $file_url;
|
|
$data['addorder'] = $addorder;
|
|
$data['new_flag'] = 1;//最新
|
|
$data['flag'] = 1;//后台审核完上传,无需再审
|
|
|
|
$file_id = Db::name('cult4upfiles')->insert($data,false,true);
|
|
|
|
} else {
|
|
$this->error($file->getError());//否则就是上传错误,显示错误原因
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
$this->success('上传成功');
|
|
}
|
|
/*
|
|
* 初审
|
|
* 初审中(已提交):1
|
|
* 初审中(联席会已复议):19
|
|
*/
|
|
public function apply_runupload1()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==1 or $status==19)
|
|
$this->apply_runupload(1,$status);
|
|
else
|
|
$this->apply_runupload(1,1);
|
|
}
|
|
/*
|
|
* 尽调
|
|
* 尽调中(初审已通过):2
|
|
* 尽调中(联席会已复议):36
|
|
*/
|
|
public function apply_runupload2()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==2 or $status==36)
|
|
$this->apply_runupload(2,$status);
|
|
else
|
|
$this->apply_runupload(2,2);
|
|
}
|
|
/*
|
|
* 复审
|
|
* 复审中(已尽调):5
|
|
* 复审中(联席会已复议):20
|
|
*/
|
|
public function apply_runupload3()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==5 or $status==20)
|
|
$this->apply_runupload(3,$status);
|
|
else
|
|
$this->apply_runupload(3,5);
|
|
}
|
|
/*
|
|
* 风控
|
|
* 风控审核中(复审已通过):6
|
|
* 风控审核中(联席会已复议):21
|
|
*/
|
|
public function apply_runupload4()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==6 or $status==21)
|
|
$this->apply_runupload(4,$status);
|
|
else
|
|
$this->apply_runupload(4,6);
|
|
}
|
|
/*
|
|
* 缴费确认中
|
|
* 缴费确认中(联席会已复议):39
|
|
*/
|
|
public function apply_runupload6()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==9 or $status==12 or $status==22 or $status==39)
|
|
$this->apply_runupload(6,$status);
|
|
else
|
|
$this->apply_runupload(6,12);
|
|
}
|
|
/*
|
|
* 专家审核确认
|
|
* 专家评分中(联席会已复议):23
|
|
*/
|
|
public function apply_runupload8()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==14 or $status==15 or $status==23)
|
|
$this->apply_runupload(8,$status);
|
|
else
|
|
$this->apply_runupload(8,15);
|
|
}
|
|
/*
|
|
* 联席会
|
|
*/
|
|
public function apply_runupload9()
|
|
{
|
|
//上报中(初审未通过):4
|
|
//上报中(尽调未通过):34
|
|
//上报中(复审未通过):8
|
|
//上报中(风控审核未通过):11
|
|
//上报中(未缴费未通过):13
|
|
//上报中(专家审核未通过):17
|
|
//上报中(材料核实未通过):28
|
|
//联席会审核中(已确认专家审核):16
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==4 or $status==8 or $status==11 or $status==13 or $status==17 or $status==34 or $status==16 or $status==28)
|
|
$this->apply_runupload(9,$status);
|
|
else
|
|
$this->apply_runupload(9,16);
|
|
}
|
|
/*
|
|
* 材料核实
|
|
*/
|
|
public function apply_runupload10()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==25 or $status==46 or $status==47)
|
|
$this->apply_runupload(10,$status);
|
|
else
|
|
$this->apply_runupload(10,25);
|
|
}
|
|
/*
|
|
* 后台上传操作
|
|
*/
|
|
public function apply_runuploadlogo(){
|
|
$apply_id=input('apply_id');
|
|
$user_id=session('admin_auth.aid');
|
|
//权限检查
|
|
if ((check_cult4UserRight($apply_id, $user_id, 27) == 0) && (check_cult4UserRight($apply_id, $user_id, 48) == 0) && (check_cult4UserRight($apply_id, $user_id, 29) == 0)) {
|
|
$this->error('无权限',url('home/Listn/ts_insert_gy'));
|
|
}
|
|
|
|
$file = request()->file('filelogo');
|
|
if(!empty($file)) {
|
|
$validate = config('upload_validate');
|
|
unset($validate['ext']);//不限制后缀
|
|
//单图
|
|
$info = $file->validate($validate)->rule('uniqid')->move(ROOT_PATH . config('upload_path') . DS . date('Y-m-d'));
|
|
|
|
if ($info) {
|
|
$file_url = config('upload_path') . '/' . date('Y-m-d') . '/' . $info->getFilename();
|
|
}
|
|
}else {
|
|
$this->error('Logo上传失败',url('home/Listn/ts_insert_gy#nm',array('apply_id'=>$apply_id,'snd'=>rand(10000,99999))));
|
|
}
|
|
$data = [
|
|
'logo' => $file_url,
|
|
];
|
|
$where = [
|
|
'apply_id' => $apply_id,
|
|
'new_flag' => 1,
|
|
];
|
|
Db::name('cult4baseinfo')->where($where)->update($data);
|
|
|
|
$this->success('上传成功',url('home/Listn/ts_insert_logo#nm',array('apply_id'=>$apply_id,'snd'=>rand(10000,99999))));
|
|
// $this->success('上传成功',url('cult4/Cult4/apply_check12#nm',array('apply_id'=>$apply_id,'snd'=>rand(10000,99999))));
|
|
}
|
|
public function apply_runbasecode(){
|
|
$apply_id=input('apply_id');
|
|
$user_id=session('admin_auth.aid');
|
|
//权限检查
|
|
if ((check_cult4UserRight($apply_id, $user_id, 27) == 0) && (check_cult4UserRight($apply_id, $user_id, 48) == 0) && (check_cult4UserRight($apply_id, $user_id, 29) == 0)) {
|
|
$this->error('无权限',url('home/Listn/ts_insert_hm',array('apply_id'=>$apply_id,'snd'=>rand(10000,99999))));
|
|
}
|
|
$status=48;//公告资料提交中(已提交基础信息):48
|
|
Db::startTrans();
|
|
try{
|
|
$data = [
|
|
'pay_img' => "",
|
|
];
|
|
$where = [
|
|
'apply_id' => $apply_id,
|
|
];
|
|
Db::name('cult4apply')->where($where)->update($data);
|
|
//cult4baseinfo修改记录
|
|
$data = [
|
|
'shortname' => input('shortname'),
|
|
'codetype' => input('codetype'),
|
|
'code_id' => input('saleno',0),
|
|
];
|
|
$where = [
|
|
'apply_id' => $apply_id,
|
|
'new_flag' => 1,
|
|
];
|
|
Db::name('cult4baseinfo')->where($where)->update($data);
|
|
|
|
//修改主表
|
|
$data = [
|
|
'update_time' => time(),
|
|
'update_user_id' => session('hid'),
|
|
'update_user_type' => 1,
|
|
'seq' => 0,
|
|
'status' => $status
|
|
];
|
|
$where2 = [
|
|
'apply_id' => $apply_id,
|
|
];
|
|
Db::name('cult4apply')->where($where2)->update($data);
|
|
|
|
if(input('codetype')==1){
|
|
$sl_data = [
|
|
'salestatus' => 1
|
|
];
|
|
$where3 = [
|
|
'id' => input('saleno',0),
|
|
];
|
|
Db::name('cult4number')->where($where3)->update($sl_data);
|
|
}
|
|
|
|
// 提交事务
|
|
Db::commit();
|
|
} catch (\Exception $e) {
|
|
// 回滚事务
|
|
Db::rollback();
|
|
$this->error('更新失败',url('cult4/Cult4/apply_check11#nm',array('apply_id'=>$apply_id,'snd'=>rand(10000,99999))));
|
|
}
|
|
$this->success('更新成功',url('cult4/Cult4/apply_check11#nm',array('apply_id'=>$apply_id,'snd'=>rand(10000,99999))));
|
|
}
|
|
/*
|
|
* 材料核实
|
|
*/
|
|
public function apply_runupload11()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==48 or $status==29 or $status==27)
|
|
$this->apply_runupload(11,$status);
|
|
else
|
|
$this->apply_runupload(11,48);
|
|
}
|
|
|
|
/*
|
|
* 挂牌上市
|
|
*/
|
|
public function apply_runupload12()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==51 or $status==30)
|
|
$this->apply_runupload(12,$status);
|
|
else
|
|
$this->apply_runupload(12,51);
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
* 后台文件审核历史查看
|
|
*/
|
|
public function apply_uphistory($process,$status){
|
|
$apply_id=input('apply_id');
|
|
$user_id=session('admin_auth.aid');
|
|
//if($process==99)$user_id=0;
|
|
if($process!=99){
|
|
//权限检查
|
|
if (check_cult4UserRight($apply_id, $user_id, $status) == 0) {
|
|
$this->error('无权限'.$process,url('admin/Index/index'));
|
|
}
|
|
}
|
|
|
|
$ftype=-1;//不限制ftype类型
|
|
$ftype_id=input('ftype_id');
|
|
$new_flag=0;//历史记录
|
|
$this->assign('apply_id',$apply_id);
|
|
$this->assign('process',$process);
|
|
$searchstatus = -1;
|
|
$files_list=UpfilesModel::getList($apply_id,$ftype,$searchstatus,$ftype_id,$new_flag);
|
|
|
|
$this->assign('files_list',$files_list);
|
|
return $this->fetch();
|
|
}
|
|
/*
|
|
* 初审
|
|
* 初审中(已提交):1
|
|
* 初审中(联席会已复议):19
|
|
*/
|
|
public function apply_uphistory1()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==1 or $status==19)
|
|
return $this->apply_uphistory(1,$status);
|
|
else
|
|
return $this->apply_uphistory(1,1);
|
|
}
|
|
/*
|
|
* 尽调
|
|
* 尽调中(初审已通过):2
|
|
* 尽调中(联席会已复议):36
|
|
*/
|
|
public function apply_uphistory2()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==2 or $status==36)
|
|
return $this->apply_uphistory(2,$status);
|
|
else
|
|
return $this->apply_uphistory(2,2);
|
|
}
|
|
/*
|
|
* 复审
|
|
* 复审中(已尽调):5
|
|
* 复审中(联席会已复议):20
|
|
*/
|
|
public function apply_uphistory3()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==5 or $status==20)
|
|
return $this->apply_uphistory(3,$status);
|
|
else
|
|
return $this->apply_uphistory(3,5);
|
|
}
|
|
/*
|
|
* 风控
|
|
* 风控审核中(复审已通过):6
|
|
* 风控审核中(联席会已复议):21
|
|
*/
|
|
public function apply_uphistory4()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==6 or $status==21)
|
|
return $this->apply_uphistory(4,$status);
|
|
else
|
|
return $this->apply_uphistory(4,6);
|
|
}
|
|
/*
|
|
* 缴费确认
|
|
* 缴费确认中(联席会已复议):39
|
|
*/
|
|
public function apply_uphistory6()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==9 or $status==12 or $status==22 or $status==39)
|
|
return $this->apply_uphistory(6,$status);
|
|
else
|
|
return $this->apply_uphistory(6,12);
|
|
}
|
|
/*
|
|
* 专家审核确认
|
|
* 专家评分中(联席会已复议):23
|
|
*/
|
|
public function apply_uphistory8()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==14 or $status==15 or $status==23)
|
|
return $this->apply_uphistory(8,$status);
|
|
else
|
|
return $this->apply_uphistory(8,15);
|
|
}
|
|
/*
|
|
* 联席会
|
|
*/
|
|
public function apply_uphistory9()
|
|
{
|
|
//上报中(初审未通过):4
|
|
//上报中(尽调未通过):34
|
|
//上报中(复审未通过):8
|
|
//上报中(风控审核未通过):11
|
|
//上报中(未缴费未通过):13
|
|
//上报中(专家审核未通过):17
|
|
//上报中(材料核实未通过):28
|
|
//联席会审核中(已确认专家审核):16
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==4 or $status==8 or $status==11 or $status==13 or $status==17 or $status==34 or $status==28 or $status==16)
|
|
return $this->apply_uphistory(9,$status);
|
|
else
|
|
return $this->apply_uphistory(9,16);
|
|
}
|
|
/*
|
|
* 材料核实
|
|
*/
|
|
public function apply_uphistory10()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==25 or $status==46 or $status==47)
|
|
return $this->apply_uphistory(10,$status);
|
|
else
|
|
return $this->apply_uphistory(10,25);
|
|
}
|
|
/*
|
|
* 公告材料核实
|
|
*/
|
|
public function apply_uphistory11()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==48 or $status==29 or $status==27)
|
|
return $this->apply_uphistory(11,$status);
|
|
else
|
|
return $this->apply_uphistory(11,48);
|
|
}
|
|
|
|
/*
|
|
* 挂牌上市审核
|
|
*/
|
|
public function apply_uphistory12()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==51 or $status==30)
|
|
return $this->apply_uphistory(12,$status);
|
|
else
|
|
return $this->apply_uphistory(12,51);
|
|
}
|
|
/*
|
|
* 挂牌完成
|
|
*/
|
|
public function apply_uphistory_final()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==31)
|
|
return $this->apply_uphistory(99,$status);
|
|
else
|
|
return $this->apply_uphistory(99,31);
|
|
}
|
|
|
|
|
|
/**
|
|
* 文化四板缴费
|
|
*/
|
|
public function apply_fee()
|
|
{
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
$this->error('用户ID不存在', url('cult4/Cult4/apply_list5'));
|
|
}
|
|
|
|
$apply_id=$id;
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
|
|
if($status!=9 and $status!=12)
|
|
$this->error('非缴费状态',url('admin/Index/index'));
|
|
|
|
$user_id=session('admin_auth.aid');
|
|
|
|
//更新缴费表为已缴费
|
|
$sl_data['update_id']=$user_id;
|
|
$sl_data['update_time']=time();
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
'new_flag'=>1,
|
|
);
|
|
|
|
$flag = Db::name('cult4fee')->where($where)->value('fee_flag',0);
|
|
if($flag==1){
|
|
//权限检查 (未被缴费确认用户受理的数据可以取消缴费)
|
|
if ( (check_cult4UserRight($apply_id, 0, $status) == 0) and (check_cult4UserRight($apply_id, $user_id, $status) == 0)) {
|
|
$this->error('无权限',url('admin/Index/index'));
|
|
}
|
|
|
|
//更新最新记录为历史记录
|
|
$sl_data['new_flag']=0;
|
|
Db::name('cult4fee')->where($where)->update($sl_data);
|
|
|
|
//更新缴费表
|
|
$sl_data1['apply_id']=$apply_id;
|
|
$sl_data1['fee_flag'] = 0;
|
|
$sl_data1['fee'] = 0;
|
|
$sl_data1['update_id']=session('admin_auth.aid');
|
|
$sl_data1['update_time']=time();
|
|
$sl_data1['new_flag'] = 1;
|
|
$sl_data1['addorder']=0;
|
|
//找到当前最大addorder
|
|
$addorder=Db::name('cult4fee')->where($where)->order('addorder desc') ->find ();
|
|
if(!empty($addorder)){
|
|
$sl_data1['addorder']=$sl_data1['addorder']+1;
|
|
}
|
|
Db::name('cult4fee')->insert($sl_data1);
|
|
|
|
//更新主表状态
|
|
$sl_data2['apply_id']=$apply_id;
|
|
$sl_data2['status']=9;
|
|
$sl_data2['update_user_id']=$user_id;
|
|
$sl_data2['update_user_type']=2;//后台
|
|
$sl_data2['update_time']=time();
|
|
$sl_data2['apply_admin_id']=0;
|
|
$where2=array(
|
|
'apply_id'=>$apply_id,
|
|
'status'=>12,
|
|
);
|
|
Db::name('cult4apply')->where($where2)->update($sl_data2);
|
|
|
|
$this->success('当前未缴费');
|
|
}else{
|
|
//权限检查
|
|
if (check_cult4UserRight($apply_id, $user_id, $status) == 0) {
|
|
$this->error('无权限',url('admin/Index/index'));
|
|
}
|
|
|
|
//更新最新记录为历史记录
|
|
$sl_data['new_flag']=0;
|
|
Db::name('cult4fee')->where($where)->update($sl_data);
|
|
|
|
//更新缴费表
|
|
$sl_data1['apply_id']=$apply_id;
|
|
$sl_data1['fee_flag'] = 1;
|
|
$sl_data1['fee'] = 0;
|
|
$sl_data1['update_id']=session('admin_auth.aid');
|
|
$sl_data1['update_time']=time();
|
|
$sl_data1['new_flag'] = 1;
|
|
$sl_data1['addorder']=0;
|
|
//找到当前最大addorder
|
|
$addorder=Db::name('cult4fee')->where($where)->order('addorder desc') ->find ();
|
|
if(!empty($addorder)){
|
|
$sl_data1['addorder']=$sl_data1['addorder']+1;
|
|
}
|
|
Db::name('cult4fee')->insert($sl_data1);
|
|
|
|
//更新主表状态
|
|
$sl_data2['apply_id']=$apply_id;
|
|
$sl_data2['status']=12;
|
|
$sl_data2['update_user_id']=$user_id;
|
|
$sl_data2['update_user_type']=2;//后台
|
|
$sl_data2['update_time']=time();
|
|
$sl_data2['apply_admin_id']=0;
|
|
$where2=array(
|
|
'apply_id'=>$apply_id,
|
|
'status'=>9,
|
|
);
|
|
Db::name('cult4apply')->where($where2)->update($sl_data2);
|
|
|
|
$this->success('当前已缴费');
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
* 初审操作
|
|
* 初审中(已提交):1
|
|
* 初审中(联席会已复议):19
|
|
*/
|
|
public function apply_runcheck1(){
|
|
//本处理对应状态
|
|
$chkStatusArray = array(1, 19);
|
|
$apply_id=input('apply_id');
|
|
$curStatus=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
$user_id=session('admin_auth.aid');
|
|
//权限检查
|
|
$chkStatus=0;
|
|
foreach ($chkStatusArray as $v) {
|
|
if(check_cult4UserRight($apply_id,$user_id,$v)!=0){
|
|
$chkStatus=$v;
|
|
break;
|
|
}
|
|
}
|
|
if($chkStatus==0)$this->error('无权限',url('admin/Index/index'));
|
|
|
|
if (!request()->isAjax()){
|
|
$this->error('提交方式不正确');//,url('cult4/Cult4/apply_list1')
|
|
}else {
|
|
//下面相关业务代码
|
|
if(input('submitType')==1) {
|
|
$status =2;//尽调中(初审已通过):2
|
|
}elseif(input('submitType')==2) {
|
|
$status = 3;//挂牌会员修改中(初审未通过):3
|
|
}elseif(input('submitType')==3){
|
|
$status = 4;//上报中(初审未通过):4
|
|
}elseif(input('submitType')==4 || input('submitType')==9){
|
|
$status = 32;//补交材料中(初审未通过):32
|
|
}
|
|
$passStatus=2;
|
|
$reuploadStatus=32;
|
|
|
|
if(config('cult4advice.check')==1)
|
|
{
|
|
if(input('advice')=='')
|
|
{
|
|
$this->error('请输入初审意见!');
|
|
}
|
|
}
|
|
|
|
//取得基础数据
|
|
$apply=Db::name('cult4apply')->find($apply_id);
|
|
$baseinfo=Db::name('cult4baseinfo')->find(input('base_id'));
|
|
|
|
//固定文件审核通过并且所有模板文件与文件数量对应
|
|
if( count(get_unuploadfiles($apply_id,-1,1)) > 0) {
|
|
if($status==$passStatus)
|
|
$this->error('如果文件已经审核完成,请点击补交材料!如果文件未提交或未审核,请先审核或上传文件!');
|
|
if($status==$reuploadStatus){
|
|
$rst=get_unuploadfiles($apply_id,$status,1,-1,1);
|
|
|
|
//查看是否有推荐机构上传资料
|
|
$rst2=get_unuploadfiles($apply_id,$status,1,-1,4);
|
|
|
|
if(count($rst)==0) {
|
|
if(count($rst2)>0) {
|
|
if(!$baseinfo['member_recmd']){
|
|
$this->error('未关联推荐机构,请代推荐机构添加要补交的材料!');
|
|
}
|
|
}else{
|
|
$this->error('请添加要补交的材料,或者选择要重新审核的材料!');
|
|
}
|
|
}
|
|
}
|
|
}else{
|
|
if($status==$reuploadStatus || $status==9)
|
|
$this->error('请添加要补交的材料,或者选择要重新审核的材料!');
|
|
}
|
|
|
|
//防止重复提交
|
|
if (!checkToken(input('TOKEN'))) {
|
|
return;
|
|
}
|
|
Db::startTrans();
|
|
try{
|
|
//更新初审表
|
|
$sl_data['apply_id']=input('apply_id');
|
|
$sl_data['advice'] = input('advice',"未填写");
|
|
$sl_data['create_id']=session('admin_auth.aid');
|
|
$sl_data['create_time']=time();
|
|
//找到当前最大addorder
|
|
$where=array(
|
|
'apply_id'=>input('apply_id'),
|
|
);
|
|
$check=Db::name('cult4check')->where($where)->order('addorder desc') ->find ();
|
|
if(!empty($check)){
|
|
$sl_data['addorder']=$check['addorder']+1;
|
|
}else{
|
|
$sl_data['addorder']=0;
|
|
}
|
|
Db::name('cult4check')->insert($sl_data);
|
|
|
|
//更新基本信息表为已审核
|
|
$sl_data2['base_id']=input('base_id');
|
|
$sl_data2['flag']=1;
|
|
$where2=array(
|
|
'base_id'=>input('base_id'),
|
|
);
|
|
Db::name('cult4baseinfo')->where($where2)->update($sl_data2);
|
|
|
|
//更新主表
|
|
$sl_data3['apply_id']=$apply_id;
|
|
$sl_data3['status']=$status;
|
|
$sl_data3['update_user_id']=$user_id;
|
|
$sl_data3['update_user_type']=2;//后台
|
|
$sl_data3['update_time']=time();
|
|
$sl_data3['apply_admin_id']=0;
|
|
$where3=array(
|
|
'apply_id'=>$apply_id,
|
|
'status'=>$chkStatus,//array(array('eq',1),array('eq',$admin_id),'or')
|
|
);
|
|
Db::name('cult4apply')->where($where3)->update($sl_data3);
|
|
|
|
//更新文件表当前所有未通过的记录为历史记录,上传人需要重新上传
|
|
if($status==$reuploadStatus){
|
|
$where4=array(
|
|
'apply_id'=>$apply_id,
|
|
'new_flag'=>1,//当前最新记录
|
|
'flag'=>0,//未审核通过
|
|
);
|
|
$sl_data4['new_flag']=0;
|
|
Db::name('cult4upfiles')->where($where4)->update($sl_data4);
|
|
}
|
|
|
|
if( $baseinfo['apply_type']==1){
|
|
$baseinfo_name=$baseinfo['c_name'];
|
|
}elseif ($baseinfo['apply_type']==2){
|
|
$baseinfo_name=$baseinfo['p_name'];
|
|
}else{
|
|
$baseinfo_name=$baseinfo['t_apply_username'];
|
|
}
|
|
$username=get_cult4UserName($apply['user_id'],1);
|
|
$advice=input('advice',"未填写");
|
|
$advi=input('advice');
|
|
/**
|
|
* 增加通知推送,by rainfer
|
|
*/
|
|
//审核不通过时,推送通知
|
|
if($status==3 || $status==32){
|
|
$sys=Options::get_options('begincheck_options',$this->lang);
|
|
$defaultFileLink=$advice.'</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_upedit',['apply_id'=>$apply_id]).'">补充资料</a>';
|
|
$defaultEditLink=$advice.'</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_editcheck',['apply_id'=>$apply_id]).'">修改资料</a>';
|
|
$defaultFullLink=$advice.'</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_fullcheck',['apply_id'=>$apply_id]).'">修改资料</a></br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_upcheck',['apply_id'=>$apply_id]).'">补充资料</a>';
|
|
$defaultNotice='您(或您关联)的【'.$baseinfo_name.'】挂牌申请初审不通过,需要您重新修改信息或上传资料后再提交。'.$defaultFullLink;
|
|
$sys['content_tpl']=isset($sys['content_tpl'])?$sys['content_tpl']:$defaultNotice;
|
|
$notice=$sys['content_tpl'];
|
|
$notice=str_replace('#COMNAME#',$username,$notice);
|
|
$notice=str_replace('#APPLYNAME#',$baseinfo_name,$notice);
|
|
$notice=str_replace('#DATE#',date('Y年m月d日', time()),$notice);
|
|
|
|
if($status==3){
|
|
//审核不通过,回到修改中,由会员前台重写修改提交
|
|
$notice_title='您(或您关联)的【'.$baseinfo_name.'】挂牌申请初审不通过,请修改资料!';
|
|
$notice=str_replace('#APPLYCONTENTS#',$defaultEditLink,$notice);
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$apply['user_id'],
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
}elseif($status==32){
|
|
if(input('submitType')==9) {
|
|
$notice_title='您(或您关联)的【'.$baseinfo_name.'】挂牌申请初审不通过,请修改及补充资料!';
|
|
$notice=str_replace('#APPLYCONTENTS#',$defaultFullLink,$notice);
|
|
}else{
|
|
$notice_title='您(或您关联)的【'.$baseinfo_name.'】挂牌申请初审不通过,请补充资料!';
|
|
$notice=str_replace('#APPLYCONTENTS#',$defaultFileLink,$notice);
|
|
}
|
|
//需要上传的文件
|
|
$unpassfiles=get_unuploadfiles($apply_id,$status,1);
|
|
$has_send=[];
|
|
foreach ($unpassfiles as $v){
|
|
if($v['upload_role_type']==1){
|
|
$to_uids=[];
|
|
if($v['upload_role_id']==1){
|
|
//基础会员 挂牌会员
|
|
$to_uids[]=$apply['user_id'];
|
|
}elseif ($v['upload_role_id']==3){
|
|
//专家会员
|
|
$to_uids=Db::name('cult4proassign')->where(['assign_type'=>0,'apply_id'=>$apply_id,'del_flag'=>0])->column('user_id');
|
|
}elseif ($v['upload_role_id']==4){
|
|
//推荐会员
|
|
$to_uids[]=$baseinfo['member_recmd'];
|
|
}
|
|
if($to_uids){
|
|
foreach ($to_uids as $to_uid){
|
|
//未推送过
|
|
if($to_uid && !in_array($to_uid,$has_send)){
|
|
//补交材料,回到前台补交资料
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$to_uid,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
$has_send[]=$to_uid;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if($v['upload_role_type2']==1){
|
|
$to_uids=[];
|
|
if($v['upload_role_id2']==1){
|
|
//基础会员 挂牌会员
|
|
$to_uids[]=$apply['user_id'];
|
|
}elseif ($v['upload_role_id2']==3){
|
|
//专家会员
|
|
$to_uids=Db::name('cult4proassign')->where(['assign_type'=>0,'apply_id'=>$apply_id,'del_flag'=>0])->column('user_id');
|
|
}elseif ($v['upload_role_id2']==4){
|
|
//推荐会员
|
|
$to_uids[]=$baseinfo['member_recmd'];
|
|
}
|
|
if($to_uids){
|
|
foreach ($to_uids as $to_uid){
|
|
//未推送过
|
|
if($to_uid && !in_array($to_uid,$has_send)){
|
|
//补交材料,回到前台补交资料
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$to_uid,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
$has_send[]=$to_uid;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//推送给推荐会员尽调
|
|
if($status==2){
|
|
//推荐会员
|
|
$to_uid=$baseinfo['member_recmd'];
|
|
if($to_uid){
|
|
$notice_title='【'.$baseinfo_name.'】挂牌申请需要您做尽职调查!';
|
|
$notice='您关联的【'.$baseinfo_name.'】申请需要您做尽职调查。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_jtcheck',['apply_id'=>$apply_id]).'">尽职调查</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$to_uid,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
}
|
|
}
|
|
// 提交事务
|
|
Db::commit();
|
|
} catch (\Exception $e) {
|
|
// 回滚事务
|
|
Db::rollback();
|
|
$this->error('初审失败');
|
|
}
|
|
$this->success('初审成功',url('cult4/Cult4/apply_list1'));
|
|
}
|
|
}
|
|
/*
|
|
* 尽职调查操作
|
|
* 尽调中(初审已通过):2
|
|
* 尽调中(联席会已复议):36
|
|
*/
|
|
public function apply_runcheck2(){
|
|
//本处理对应状态
|
|
$chkStatusArray = array(2, 36);
|
|
$apply_id=input('apply_id');
|
|
$curStatus=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
$user_id=session('admin_auth.aid');
|
|
//权限检查
|
|
$chkStatus=0;
|
|
foreach ($chkStatusArray as $v) {
|
|
if(check_cult4UserRight($apply_id,$user_id,$v)!=0){
|
|
$chkStatus=$v;
|
|
break;
|
|
}
|
|
}
|
|
if($chkStatus==0)$this->error('无权限',url('admin/Index/index'));
|
|
|
|
if (!request()->isAjax()){
|
|
$this->error('提交方式不正确');//,url('cult4/Cult4/apply_list1')
|
|
}else {
|
|
//下面相关业务代码
|
|
if(input('submitType')==1) {
|
|
$status = 5;//复审中(已尽调):5
|
|
}elseif(input('submitType')==2) {
|
|
$status = 33;//挂牌会员修改中(尽调未通过):33
|
|
}elseif(input('submitType')==3){
|
|
$status = 34;//上报中(尽调未通过):34
|
|
}elseif(input('submitType')==4){
|
|
$status = 35;//补交材料中(尽调未通过):35
|
|
}
|
|
$passStatus=5;
|
|
$reuploadStatus=35;
|
|
if(config('cult4advice.checkdd')==1)
|
|
{
|
|
if(input('advice')=='')
|
|
{
|
|
$this->error('请输入尽调意见!');
|
|
}
|
|
}
|
|
|
|
//取得基础数据
|
|
$apply=Db::name('cult4apply')->find($apply_id);
|
|
$baseinfo=Db::name('cult4baseinfo')->find(input('base_id'));
|
|
|
|
//固定文件审核通过并且所有模板文件与文件数量对应
|
|
if( count(get_unuploadfiles($apply_id,-1,2)) > 0) {
|
|
if($status==$passStatus)
|
|
$this->error('如果文件已经审核完成,请点击补交材料!如果文件未提交或未审核,请先审核或上传文件!');
|
|
if($status==$reuploadStatus){
|
|
//查看是否有前台会员上传资料
|
|
$rst=get_unuploadfiles($apply_id,$status,2,-1,1);
|
|
//查看是否有推荐机构上传资料
|
|
$rst2=get_unuploadfiles($apply_id,$status,2,-1,4);
|
|
|
|
if(count($rst)==0) {
|
|
if(count($rst2)>0) {
|
|
if(!$baseinfo['member_recmd']){
|
|
$this->error('未关联推荐机构,请代推荐机构添加要补交的材料!');
|
|
}
|
|
}else{
|
|
$this->error('请添加要补交的材料,或者选择要重新审核的材料!');
|
|
}
|
|
}
|
|
}
|
|
}else{
|
|
if($status==$reuploadStatus)
|
|
$this->error('请添加要补交的材料,或者选择要重新审核的材料!');
|
|
}
|
|
|
|
//防止重复提交
|
|
if (!checkToken(input('TOKEN'))) {
|
|
return;
|
|
}
|
|
|
|
Db::startTrans();
|
|
|
|
try{
|
|
//更新尽调表cult4checkdd
|
|
$sl_data['apply_id']=$apply_id;
|
|
$sl_data['advice'] = input('advice',"未填写");
|
|
$sl_data['create_id']=$user_id;
|
|
$sl_data['create_time']=time();
|
|
|
|
//找到当前最大addorder
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
);
|
|
$check=Db::name('cult4checkdd')->where($where)->order('addorder desc') ->find ();
|
|
if(!empty($check)){
|
|
$sl_data['addorder']=$check['addorder']+1;
|
|
}else{
|
|
$sl_data['addorder']=0;
|
|
}
|
|
Db::name('cult4checkdd')->insert($sl_data);
|
|
|
|
//更新基本信息表为已审核cult4baseinfo
|
|
$sl_data2['base_id']=input('base_id');
|
|
$sl_data2['flag']=1;
|
|
$where2=array(
|
|
'base_id'=>input('base_id'),
|
|
);
|
|
Db::name('cult4baseinfo')->where($where2)->update($sl_data2);
|
|
|
|
//更新主表cult4apply
|
|
$sl_data3['apply_id']=$apply_id;
|
|
$sl_data3['status']=6;
|
|
$sl_data3['update_user_id']=$user_id;
|
|
$sl_data3['update_user_type']=2;//后台
|
|
$sl_data3['update_time']=time();
|
|
$sl_data3['apply_admin_id']=0;
|
|
$where3=array(
|
|
'apply_id'=>$apply_id,
|
|
'status'=>$chkStatus,//array(array('eq',1),array('eq',$admin_id),'or')
|
|
);
|
|
Db::name('cult4apply')->where($where3)->update($sl_data3);
|
|
|
|
//更新文件表当前所有未通过的记录为历史记录,上传人需要重新上传
|
|
if($status==$reuploadStatus){
|
|
$where4=array(
|
|
'apply_id'=>$apply_id,
|
|
'new_flag'=>1,//当前最新记录
|
|
'flag'=>0,//未审核通过
|
|
);
|
|
$sl_data4['new_flag']=0;
|
|
Db::name('cult4upfiles')->where($where4)->update($sl_data4);
|
|
}
|
|
/**
|
|
* 增加通知推送,by rainfer
|
|
*/
|
|
//审核不通过时,推送通知
|
|
if($status==33 || $status==35){
|
|
if($baseinfo['apply_type']==1){
|
|
$baseinfo_name=$baseinfo['c_name'];
|
|
}elseif ($baseinfo['apply_type']==2){
|
|
$baseinfo_name=$baseinfo['p_name'];
|
|
}else{
|
|
$baseinfo_name=$baseinfo['t_apply_username'];
|
|
}
|
|
if($status==33){
|
|
//审核不通过,回到修改中,由会员前台重写修改提交
|
|
$notice_title='【'.$baseinfo_name.'】申请尽调不通过!';
|
|
$notice='您的【'.$baseinfo_name.'】申请尽调不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_editcheck',['apply_id'=>$apply_id]).'">修改材料</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$apply['user_id'],
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
}elseif($status==35){
|
|
//需要上传的文件
|
|
$unpassfiles=get_unuploadfiles($apply_id,$status,2);
|
|
$has_send=[];
|
|
foreach ($unpassfiles as $v){
|
|
if($v['upload_role_type']==1){
|
|
$to_uids=[];
|
|
if($v['upload_role_id']==1){
|
|
//基础会员 挂牌会员
|
|
$to_uids[]=$apply['user_id'];
|
|
}elseif ($v['upload_role_id']==3){
|
|
//专家会员
|
|
$to_uids=Db::name('cult4proassign')->where(['assign_type'=>0,'apply_id'=>$apply_id,'del_flag'=>0])->column('user_id');
|
|
}elseif ($v['upload_role_id']==4){
|
|
//推荐会员
|
|
$to_uids[]=$baseinfo['member_recmd'];
|
|
}
|
|
if($to_uids){
|
|
foreach ($to_uids as $to_uid){
|
|
//未推送过
|
|
if($to_uid && !in_array($to_uid,$has_send)){
|
|
//补交材料,回到前台补交资料
|
|
$notice_title='【'.$baseinfo_name.'】申请尽调不通过,请补充资料!';
|
|
$notice='您(或您关联)的【'.$baseinfo_name.'】申请尽调不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_upcheck',['apply_id'=>$apply_id]).'">补充资料</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$to_uid,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
$has_send[]=$to_uid;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if($v['upload_role_type2']==1){
|
|
$to_uids=[];
|
|
if($v['upload_role_id2']==1){
|
|
//基础会员 挂牌会员
|
|
$to_uids[]=$apply['user_id'];
|
|
}elseif ($v['upload_role_id2']==3){
|
|
//专家会员
|
|
$to_uids=Db::name('cult4proassign')->where(['assign_type'=>0,'apply_id'=>$apply_id,'del_flag'=>0])->column('user_id');
|
|
}elseif ($v['upload_role_id2']==4){
|
|
//推荐会员
|
|
$to_uids[]=$baseinfo['member_recmd'];
|
|
}
|
|
if($to_uids){
|
|
foreach ($to_uids as $to_uid){
|
|
//未推送过
|
|
if($to_uid && !in_array($to_uid,$has_send)){
|
|
//补交材料,回到前台补交资料
|
|
$notice_title='【'.$baseinfo_name.'】申请尽调不通过,请补充资料!';
|
|
$notice='您(或您关联)的【'.$baseinfo_name.'】申请尽调不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_upcheck',['apply_id'=>$apply_id]).'">补充资料</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$to_uid,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
$has_send[]=$to_uid;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 提交事务
|
|
Db::commit();
|
|
} catch (\Exception $e) {
|
|
// 回滚事务
|
|
Db::rollback();
|
|
$this->error('尽调失败');
|
|
}
|
|
$this->success('尽调成功',url('cult4/Cult4/apply_list2'));
|
|
}
|
|
}
|
|
/*
|
|
* 复审中(已尽调):5
|
|
* 复审中(联席会已复议):20
|
|
*/
|
|
public function apply_runcheck3(){
|
|
//本处理对应状态
|
|
$chkStatusArray = array(5, 20);
|
|
$apply_id=input('apply_id');
|
|
$curStatus=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
$user_id=session('admin_auth.aid');
|
|
//权限检查
|
|
$chkStatus=0;
|
|
foreach ($chkStatusArray as $v) {
|
|
if(check_cult4UserRight($apply_id,$user_id,$v)!=0){
|
|
$chkStatus=$v;
|
|
break;
|
|
}
|
|
}
|
|
if($chkStatus==0)$this->error('无权限',url('admin/Index/index'));
|
|
|
|
if (!request()->isAjax()){
|
|
$this->error('提交方式不正确');
|
|
}else {
|
|
//下面相关业务代码
|
|
if(input('submitType')==1) {
|
|
$status = 6;//风控审核中(复审已通过):6
|
|
}elseif(input('submitType')==2) {
|
|
$status = 7;//挂牌会员修改中(复审未通过):7
|
|
}elseif(input('submitType')==3){
|
|
$status = 8;//上报中(复审未通过):8
|
|
}elseif(input('submitType')==4){
|
|
$status = 37;//补交材料中(复审未通过):37
|
|
}
|
|
$passStatus=6;
|
|
$reuploadStatus=37;
|
|
if(config('cult4advice.checkreview')==1)
|
|
{
|
|
if(input('advice')=='')
|
|
{
|
|
$this->error('请输入复审意见!');
|
|
}
|
|
}
|
|
|
|
//取得基础数据
|
|
$apply=Db::name('cult4apply')->find($apply_id);
|
|
$baseinfo=Db::name('cult4baseinfo')->find(input('base_id'));
|
|
|
|
//固定文件审核通过并且所有模板文件与文件数量对应
|
|
if( count(get_unuploadfiles($apply_id,-1,3)) > 0) {
|
|
if($status==$passStatus)
|
|
$this->error('如果文件已经审核完成,请点击补交材料!如果文件未提交或未审核,请先审核或上传文件!');
|
|
if($status==$reuploadStatus){
|
|
$rst=get_unuploadfiles($apply_id,$status,3,-1,1);
|
|
|
|
//查看是否有推荐机构上传资料
|
|
$rst2=get_unuploadfiles($apply_id,$status,3,-1,4);
|
|
|
|
if(count($rst)==0) {
|
|
if(count($rst2)>0) {
|
|
if(!$baseinfo['member_recmd']){
|
|
$this->error('未关联推荐机构,请代推荐机构添加要补交的材料!');
|
|
}
|
|
}else{
|
|
$this->error('请添加要补交的材料,或者选择要重新审核的材料!');
|
|
}
|
|
}
|
|
}
|
|
}else{
|
|
if($status==$reuploadStatus)
|
|
$this->error('请添加要补交的材料,或者选择要重新审核的材料!');
|
|
}
|
|
//防止重复提交
|
|
if (!checkToken(input('TOKEN'))) {
|
|
return;
|
|
}
|
|
|
|
Db::startTrans();
|
|
|
|
try{
|
|
//更新复审表cult4checkreview
|
|
$sl_data['apply_id']=$apply_id;
|
|
$sl_data['advice'] = input('advice',"未填写");
|
|
$sl_data['create_id']=$user_id;
|
|
$sl_data['create_time']=time();
|
|
|
|
//找到当前最大addorder
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
);
|
|
$check=Db::name('cult4checkreview')->where($where)->order('addorder desc') ->find ();
|
|
if(!empty($check)){
|
|
$sl_data['addorder']=$check['addorder']+1;
|
|
}else{
|
|
$sl_data['addorder']=0;
|
|
}
|
|
Db::name('cult4checkreview')->insert($sl_data);
|
|
|
|
//更新基本信息表为已审核cult4baseinfo
|
|
$sl_data2['base_id']=input('base_id');
|
|
$sl_data2['flag']=1;
|
|
$where2=array(
|
|
'base_id'=>input('base_id'),
|
|
);
|
|
Db::name('cult4baseinfo')->where($where2)->update($sl_data2);
|
|
|
|
//更新主表cult4apply
|
|
$sl_data3['apply_id']=$apply_id;
|
|
$sl_data3['status']=$status;
|
|
$sl_data3['update_user_id']=$user_id;
|
|
$sl_data3['update_user_type']=2;//后台
|
|
$sl_data3['update_time']=time();
|
|
$sl_data3['apply_admin_id']=0;
|
|
$where3=array(
|
|
'apply_id'=>$apply_id,
|
|
'status'=>$chkStatus,//array(array('eq',1),array('eq',$admin_id),'or')
|
|
);
|
|
Db::name('cult4apply')->where($where3)->update($sl_data3);
|
|
|
|
//更新文件表当前所有未通过的记录为历史记录,上传人需要重新上传
|
|
if($status==$reuploadStatus){
|
|
$where4=array(
|
|
'apply_id'=>$apply_id,
|
|
'new_flag'=>1,//当前最新记录
|
|
'flag'=>0,//未审核通过
|
|
);
|
|
$sl_data4['new_flag']=0;
|
|
Db::name('cult4upfiles')->where($where4)->update($sl_data4);
|
|
}
|
|
/**
|
|
* 增加通知推送,by rainfer
|
|
*/
|
|
//审核不通过时,推送通知
|
|
if($status==7 || $status==37){
|
|
if($baseinfo['apply_type']==1){
|
|
$baseinfo_name=$baseinfo['c_name'];
|
|
}elseif ($baseinfo['apply_type']==2){
|
|
$baseinfo_name=$baseinfo['p_name'];
|
|
}else{
|
|
$baseinfo_name=$baseinfo['t_apply_username'];
|
|
}
|
|
if($status==7){
|
|
//审核不通过,回到修改中,由会员前台重写修改提交
|
|
$notice_title='【'.$baseinfo_name.'】申请复审不通过!';
|
|
$notice='您的【'.$baseinfo_name.'】申请复审不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_editcheck',['apply_id'=>$apply_id]).'">修改材料</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$apply['user_id'],
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
}elseif($status==37){
|
|
//需要上传的文件
|
|
$unpassfiles=get_unuploadfiles($apply_id,$status,3);
|
|
$has_send=[];
|
|
foreach ($unpassfiles as $v){
|
|
if($v['upload_role_type']==1){
|
|
$to_uids=[];
|
|
if($v['upload_role_id']==1){
|
|
//基础会员 挂牌会员
|
|
$to_uids[]=$apply['user_id'];
|
|
}elseif ($v['upload_role_id']==3){
|
|
//专家会员
|
|
$to_uids=Db::name('cult4proassign')->where(['assign_type'=>0,'apply_id'=>$apply_id,'del_flag'=>0])->column('user_id');
|
|
}elseif ($v['upload_role_id']==4){
|
|
//推荐会员
|
|
$to_uids[]=$baseinfo['member_recmd'];
|
|
}
|
|
if($to_uids){
|
|
foreach ($to_uids as $to_uid){
|
|
//未推送过
|
|
if($to_uid && !in_array($to_uid,$has_send)){
|
|
//补交材料,回到前台补交资料
|
|
$notice_title='【'.$baseinfo_name.'】申请复审不通过,请补充资料!';
|
|
$notice='您(或您关联)的【'.$baseinfo_name.'】申请复审不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_upcheck',['apply_id'=>$apply_id]).'">补充资料</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$to_uid,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
$has_send[]=$to_uid;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if($v['upload_role_type2']==1){
|
|
$to_uids=[];
|
|
if($v['upload_role_id2']==1){
|
|
//基础会员 挂牌会员
|
|
$to_uids[]=$apply['user_id'];
|
|
}elseif ($v['upload_role_id2']==3){
|
|
//专家会员
|
|
$to_uids=Db::name('cult4proassign')->where(['assign_type'=>0,'apply_id'=>$apply_id,'del_flag'=>0])->column('user_id');
|
|
}elseif ($v['upload_role_id2']==4){
|
|
//推荐会员
|
|
$to_uids[]=$baseinfo['member_recmd'];
|
|
}
|
|
if($to_uids){
|
|
foreach ($to_uids as $to_uid){
|
|
//未推送过
|
|
if($to_uid && !in_array($to_uid,$has_send)){
|
|
//补交材料,回到前台补交资料
|
|
$notice_title='【'.$baseinfo_name.'】申请复审不通过,请补充资料!';
|
|
$notice='您(或您关联)的【'.$baseinfo_name.'】申请复审不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_upcheck',['apply_id'=>$apply_id]).'">补充资料</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$to_uid,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
$has_send[]=$to_uid;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 提交事务
|
|
Db::commit();
|
|
} catch (\Exception $e) {
|
|
// 回滚事务
|
|
Db::rollback();
|
|
$this->error('复审失败');
|
|
}
|
|
$this->success('复审成功',url('cult4/Cult4/apply_list3'));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
* 风控审核中(复审已通过):6
|
|
* 风控审核中(联席会已复议):21
|
|
*/
|
|
public function apply_runcheck4(){
|
|
//本处理对应状态
|
|
$chkStatusArray = array(6, 21);
|
|
$apply_id=input('apply_id');
|
|
$curStatus=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
$user_id=session('admin_auth.aid');
|
|
//权限检查
|
|
$chkStatus=0;
|
|
foreach ($chkStatusArray as $v) {
|
|
if(check_cult4UserRight($apply_id,$user_id,$v)!=0){
|
|
$chkStatus=$v;
|
|
break;
|
|
}
|
|
}
|
|
if($chkStatus==0)$this->error('无权限',url('admin/Index/index'));
|
|
|
|
if (!request()->isAjax()){
|
|
$this->error('提交方式不正确');
|
|
}else {
|
|
//下面相关业务代码
|
|
if(input('submitType')==1) {
|
|
$status = 9;//缴费中(风控审核通过):9
|
|
}elseif(input('submitType')==2) {
|
|
$status = 10;//挂牌会员修改中(风控审核未通过):10
|
|
}elseif(input('submitType')==3){
|
|
$status = 11;//上报中(风控审核未通过):11
|
|
}elseif(input('submitType')==4){
|
|
$status = 38;//补交材料中(风控审核未通过):38
|
|
}
|
|
$passStatus=9;
|
|
$reuploadStatus=38;
|
|
if(config('cult4advice.checkrisk')==1)
|
|
{
|
|
if(input('advice')=='')
|
|
{
|
|
$this->error('请输入风控中心审核意见!');
|
|
}
|
|
}
|
|
|
|
//取得基础数据
|
|
$apply=Db::name('cult4apply')->find($apply_id);
|
|
$baseinfo=Db::name('cult4baseinfo')->find(input('base_id'));
|
|
|
|
//固定文件审核通过并且所有模板文件与文件数量对应
|
|
if( count(get_unuploadfiles($apply_id,-1,1)) > 0) {
|
|
if($status==$passStatus)
|
|
$this->error('如果文件已经审核完成,请点击补交材料!如果文件未提交或未审核,请先审核或上传文件!');
|
|
if($status==$reuploadStatus){
|
|
$rst=get_unuploadfiles($apply_id,$status,4,-1,1);
|
|
//查看是否有推荐机构上传资料
|
|
$rst2=get_unuploadfiles($apply_id,$status,4,-1,4);
|
|
|
|
if(count($rst)==0) {
|
|
if(count($rst2)>0) {
|
|
if(!$baseinfo['member_recmd']){
|
|
$this->error('未关联推荐机构,请代推荐机构添加要补交的材料!');
|
|
}
|
|
}else{
|
|
$this->error('请添加要补交的材料,或者选择要重新审核的材料!');
|
|
}
|
|
}
|
|
}
|
|
}else{
|
|
if($status==$reuploadStatus)
|
|
$this->error('请添加要补交的材料,或者选择要重新审核的材料!');
|
|
}
|
|
|
|
//防止重复提交
|
|
if (!checkToken(input('TOKEN'))) {
|
|
return;
|
|
}
|
|
|
|
Db::startTrans();
|
|
|
|
try{
|
|
//更新复审表cult4checkreview
|
|
$sl_data['apply_id']=$apply_id;
|
|
$sl_data['advice'] = input('advice',"未填写");
|
|
$sl_data['create_id']=$user_id;
|
|
$sl_data['create_time']=time();
|
|
|
|
//找到当前最大addorder
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
);
|
|
$check=Db::name('cult4checkrisk')->where($where)->order('addorder desc') ->find ();
|
|
if(!empty($check)){
|
|
$sl_data['addorder']=$check['addorder']+1;
|
|
}else{
|
|
$sl_data['addorder']=0;
|
|
}
|
|
Db::name('cult4checkrisk')->insert($sl_data);
|
|
|
|
//更新基本信息表为已审核cult4baseinfo
|
|
$sl_data2['base_id']=input('base_id');
|
|
$sl_data2['flag']=1;
|
|
$where2=array(
|
|
'base_id'=>input('base_id'),
|
|
);
|
|
Db::name('cult4baseinfo')->where($where2)->update($sl_data2);
|
|
|
|
//更新主表cult4apply
|
|
$sl_data3['apply_id']=$apply_id;
|
|
$sl_data3['status']=$status;
|
|
$sl_data3['update_user_id']=$user_id;
|
|
$sl_data3['update_user_type']=2;//后台
|
|
$sl_data3['update_time']=time();
|
|
$sl_data3['apply_admin_id']=0;
|
|
$where3=array(
|
|
'apply_id'=>$apply_id,
|
|
'status'=>$chkStatus,//array(array('eq',1),array('eq',$admin_id),'or')
|
|
);
|
|
Db::name('cult4apply')->where($where3)->update($sl_data3);
|
|
|
|
//更新文件表当前所有未通过的记录为历史记录,上传人需要重新上传
|
|
if($status==$reuploadStatus){
|
|
$where4=array(
|
|
'apply_id'=>$apply_id,
|
|
'new_flag'=>1,//当前最新记录
|
|
'flag'=>0,//未审核通过
|
|
);
|
|
$sl_data4['new_flag']=0;
|
|
Db::name('cult4upfiles')->where($where4)->update($sl_data4);
|
|
}
|
|
$advi= input('advice');
|
|
/**
|
|
* 增加通知推送,by rainfer
|
|
*/
|
|
if($baseinfo['apply_type']==1){
|
|
$baseinfo_name=$baseinfo['c_name'];
|
|
}elseif ($baseinfo['apply_type']==2){
|
|
$baseinfo_name=$baseinfo['p_name'];
|
|
}else{
|
|
$baseinfo_name=$baseinfo['t_apply_username'];
|
|
}
|
|
//审核不通过时,推送通知
|
|
if($status==10 || $status==38){
|
|
if($status==10){
|
|
//审核不通过,回到修改中,由会员前台重写修改提交
|
|
$notice_title='【'.$baseinfo_name.'】申请风控审核不通过!';
|
|
$notice='您的【'.$baseinfo_name.'】申请风控审核不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_editcheck',['apply_id'=>$apply_id]).'">修改材料</a></br> 反驳意见:'.$advi.'';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$apply['user_id'],
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
}elseif($status==38){
|
|
//需要上传的文件
|
|
$unpassfiles=get_unuploadfiles($apply_id,$status,4);
|
|
$has_send=[];
|
|
foreach ($unpassfiles as $v){
|
|
if($v['upload_role_type']==1){
|
|
$to_uids=[];
|
|
if($v['upload_role_id']==1){
|
|
//基础会员 挂牌会员
|
|
$to_uids[]=$apply['user_id'];
|
|
}elseif ($v['upload_role_id']==3){
|
|
//专家会员
|
|
$to_uids=Db::name('cult4proassign')->where(['assign_type'=>0,'apply_id'=>$apply_id,'del_flag'=>0])->column('user_id');
|
|
}elseif ($v['upload_role_id']==4){
|
|
//推荐会员
|
|
$to_uids[]=$baseinfo['member_recmd'];
|
|
}
|
|
if($to_uids){
|
|
foreach ($to_uids as $to_uid){
|
|
//未推送过
|
|
if($to_uid && !in_array($to_uid,$has_send)){
|
|
//补交材料,回到前台补交资料
|
|
$notice_title='【'.$baseinfo_name.'】申请风控审核不通过,请补充资料!';
|
|
$notice='您(或您关联)的【'.$baseinfo_name.'】申请风控审核不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_upedit',['apply_id'=>$apply_id]).'">补充资料</a></br>反驳意见:'.$advi.'';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$to_uid,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
$has_send[]=$to_uid;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if($v['upload_role_type2']==1){
|
|
$to_uids=[];
|
|
if($v['upload_role_id2']==1){
|
|
//基础会员 挂牌会员
|
|
$to_uids[]=$apply['user_id'];
|
|
}elseif ($v['upload_role_id2']==3){
|
|
//专家会员
|
|
$to_uids=Db::name('cult4proassign')->where(['assign_type'=>0,'apply_id'=>$apply_id,'del_flag'=>0])->column('user_id');
|
|
}elseif ($v['upload_role_id2']==4){
|
|
//推荐会员
|
|
$to_uids[]=$baseinfo['member_recmd'];
|
|
}
|
|
if($to_uids){
|
|
foreach ($to_uids as $to_uid){
|
|
//未推送过
|
|
if($to_uid && !in_array($to_uid,$has_send)){
|
|
//补交材料,回到前台补交资料
|
|
$notice_title='【'.$baseinfo_name.'】申请风控审核不通过,请补充资料!';
|
|
$notice='您(或您关联)的【'.$baseinfo_name.'】申请风控审核不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_upedit',['apply_id'=>$apply_id]).'">补充资料 </a></br>反驳意见:'.$advi.'';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$to_uid,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
$has_send[]=$to_uid;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}elseif($status==8){
|
|
//风控审核通过则发送挂牌上市缴费通知
|
|
$username=get_cult4UserName($apply['user_id'],1);
|
|
$notice_title = '【' . $baseinfo_name . '】挂牌上市缴费通知书!';
|
|
$contents=Options::get_options('feecheck_options',$this->lang);
|
|
$contents['content_tpl']=isset($contents['content_tpl'])?$contents['content_tpl']:'';
|
|
$notice=$contents['content_tpl'];
|
|
if($baseinfo["gplevel"]==6){//养成板
|
|
$notice=str_replace('伍万圆整',"伍万圆整",$notice);
|
|
}elseif($baseinfo["gplevel"]==5){//天使板
|
|
$notice=str_replace('伍万圆整',"壹万圆整",$notice);
|
|
}
|
|
$notice=str_replace('#COMNAME#',$username,$notice);
|
|
$notice=str_replace('#DATE#',date('Y年m月d日', time()),$notice);
|
|
$sl_data = [
|
|
'notice_title' => $notice_title,
|
|
'notice' => $notice,
|
|
'apply_id' => $apply_id,
|
|
'user_id' => $apply['user_id'],
|
|
'create_id' => session('admin_auth.aid'),
|
|
'create_type' => 1,
|
|
'create_time' => time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
}
|
|
// 提交事务
|
|
Db::commit();
|
|
} catch (\Exception $e) {
|
|
// 回滚事务
|
|
Db::rollback();
|
|
$this->error('风控中心审核失败');
|
|
}
|
|
|
|
$this->success('风控中心审核成功',url('cult4/Cult4/apply_list4'));
|
|
}
|
|
}
|
|
/*
|
|
* 缴费中(风控审核通过):9
|
|
* 缴费中(联席会已复议):22
|
|
* 缴费确认中(已缴费):12
|
|
* 缴费确认中(联席会已复议):39
|
|
*/
|
|
public function apply_runcheck6(){
|
|
//本处理对应状态
|
|
$chkStatusArray = array(9, 12, 22, 39);
|
|
$apply_id=input('apply_id');
|
|
$curStatus=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
$user_id=session('admin_auth.aid');
|
|
//权限检查
|
|
$chkStatus=0;
|
|
foreach ($chkStatusArray as $v) {
|
|
if(check_cult4UserRight($apply_id,$user_id,$v)!=0){
|
|
$chkStatus=$v;
|
|
break;
|
|
}
|
|
}
|
|
if($chkStatus==0)$this->error('无权限',url('admin/Index/index'));
|
|
|
|
if (!request()->isAjax()){
|
|
$this->error('提交方式不正确');
|
|
}else {
|
|
//下面相关业务代码
|
|
if(input('submitType')==1) {
|
|
$status = 14;//专家分配中(缴费状态已确认):14
|
|
}elseif(input('submitType')==2){
|
|
$status = 40;//挂牌会员修改中(缴费确认未通过):40
|
|
}elseif(input('submitType')==3){
|
|
$status = 13;//上报中(未缴费未通过):13
|
|
}elseif(input('submitType')==4){
|
|
$status = 41;//补交材料中(缴费确认未通过):41
|
|
}
|
|
$passStatus=14;
|
|
$reuploadStatus=41;
|
|
if(config('cult4advice.checkfee')==1)
|
|
{
|
|
if(input('advice')=='')
|
|
{
|
|
$this->error('请输入缴费确认审核意见!');
|
|
}
|
|
}
|
|
|
|
//取得基础数据
|
|
$apply=Db::name('cult4apply')->find($apply_id);
|
|
$baseinfo=Db::name('cult4baseinfo')->find(input('base_id'));
|
|
|
|
//固定文件审核通过并且所有模板文件与文件数量对应
|
|
if( count(get_unuploadfiles($apply_id,-1,6)) > 0) {
|
|
/*if($status==$passStatus)
|
|
$this->error('如果文件已经审核完成,请点击补交材料!如果文件未提交或未审核,请先审核或上传文件!');*/
|
|
if($status==$reuploadStatus){
|
|
$rst=get_unuploadfiles($apply_id,$status,6,-1,1);
|
|
//查看是否有推荐机构上传资料
|
|
$rst2=get_unuploadfiles($apply_id,$status,6,-1,4);
|
|
|
|
if(count($rst)==0) {
|
|
if(count($rst2)>0) {
|
|
if(!$baseinfo['member_recmd']){
|
|
$this->error('未关联推荐机构,请代推荐机构添加要补交的材料!');
|
|
}
|
|
}else{
|
|
$this->error('请添加要补交的材料,或者选择要重新审核的材料!');
|
|
}
|
|
}
|
|
}
|
|
}else{
|
|
if($status==$reuploadStatus)
|
|
$this->error('请添加要补交的材料,或者选择要重新审核的材料!');
|
|
}
|
|
|
|
//防止重复提交
|
|
if (!checkToken(input('TOKEN'))) {
|
|
return;
|
|
}
|
|
|
|
Db::startTrans();
|
|
|
|
try{
|
|
//更新复审表cult4checkreview
|
|
$sl_data['apply_id']=$apply_id;
|
|
$sl_data['advice'] = input('advice',"未填写");
|
|
$sl_data['create_id']=$user_id;
|
|
$sl_data['create_time']=time();
|
|
|
|
//找到当前最大addorder
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
);
|
|
$check=Db::name('cult4checkfee')->where($where)->order('addorder desc') ->find ();
|
|
if(!empty($check)){
|
|
$sl_data['addorder']=$check['addorder']+1;
|
|
}else{
|
|
$sl_data['addorder']=0;
|
|
}
|
|
Db::name('cult4checkfee')->insert($sl_data);
|
|
|
|
//更新基本信息表为已审核cult4baseinfo
|
|
$sl_data2['base_id']=input('base_id');
|
|
$sl_data2['flag']=1;
|
|
$where2=array(
|
|
'base_id'=>input('base_id'),
|
|
);
|
|
Db::name('cult4baseinfo')->where($where2)->update($sl_data2);
|
|
|
|
//更新主表cult4apply
|
|
$sl_data3['apply_id']=$apply_id;
|
|
if($status==40){
|
|
$sl_data3['status']=9;
|
|
}else{
|
|
$sl_data3['status']=$status;
|
|
}
|
|
|
|
$sl_data3['update_user_id']=$user_id;
|
|
$sl_data3['update_user_type']=2;//后台
|
|
$sl_data3['update_time']=time();
|
|
$sl_data3['apply_admin_id']=0;
|
|
$where3=array(
|
|
'apply_id'=>$apply_id,
|
|
'status'=>$chkStatus,//array(array('eq',1),array('eq',$admin_id),'or')
|
|
);
|
|
Db::name('cult4apply')->where($where3)->update($sl_data3);
|
|
|
|
if($status==30){
|
|
//修改缴费状态
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
'new_flag'=>1,
|
|
);
|
|
//更新最新记录为历史记录
|
|
$sl_data11['new_flag']=0;
|
|
Db::name('cult4fee')->where($where)->update($sl_data11);
|
|
|
|
//更新缴费表
|
|
$sl_data1['apply_id']=$apply_id;
|
|
$sl_data1['fee_flag'] = 1;
|
|
$sl_data1['fee'] = 0;
|
|
$sl_data1['update_id']=session('admin_auth.aid');
|
|
$sl_data1['update_time']=time();
|
|
$sl_data1['new_flag'] = 1;
|
|
$sl_data1['addorder']=0;
|
|
//找到当前最大addorder
|
|
$addorder=Db::name('cult4fee')->where($where)->order('addorder desc') ->find ();
|
|
if(!empty($addorder)){
|
|
$sl_data1['addorder']=$sl_data1['addorder']+1;
|
|
}
|
|
Db::name('cult4fee')->insert($sl_data1);
|
|
}
|
|
|
|
|
|
|
|
|
|
//更新文件表当前所有未通过的记录为历史记录,上传人需要重新上传
|
|
if($status==$reuploadStatus){
|
|
$where4=array(
|
|
'apply_id'=>$apply_id,
|
|
'new_flag'=>1,//当前最新记录
|
|
'flag'=>0,//未审核通过
|
|
);
|
|
$sl_data4['new_flag']=0;
|
|
Db::name('cult4upfiles')->where($where4)->update($sl_data4);
|
|
}
|
|
/**
|
|
* 增加通知推送,by rainfer
|
|
*/
|
|
//审核不通过时,推送通知
|
|
if($status==8 || $status==41){
|
|
if($baseinfo['apply_type']==1){
|
|
$baseinfo_name=$baseinfo['c_name'];
|
|
}elseif ($baseinfo['apply_type']==2){
|
|
$baseinfo_name=$baseinfo['p_name'];
|
|
}else{
|
|
$baseinfo_name=$baseinfo['t_apply_username'];
|
|
}
|
|
if($status==8){
|
|
//审核不通过,回到修改中,由会员前台重写修改提交
|
|
/*$notice_title='【'.$baseinfo_name.'】申请缴费确认不通过!';
|
|
$notice='您的【'.$baseinfo_name.'】申请缴费确认不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_editcheck',['apply_id'=>$apply_id]).'">修改材料</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$apply['user_id'],
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);*/
|
|
//风控审核通过则发送挂牌上市缴费通知
|
|
$username=get_cult4UserName($apply['user_id'],1);
|
|
$notice_title = '【' . $baseinfo_name . '】挂牌上市缴费通知书!';
|
|
$contents=Options::get_options('feecheck_options',$this->lang);
|
|
$contents['content_tpl']=isset($contents['content_tpl'])?$contents['content_tpl']:'';
|
|
$notice=$contents['content_tpl'];
|
|
$notice=str_replace('#COMNAME#',$username,$notice);
|
|
$notice=str_replace('#DATE#',date('Y年m月d日', time()),$notice);
|
|
$sl_data = [
|
|
'notice_title' => $notice_title,
|
|
'notice' => $notice,
|
|
'apply_id' => $apply_id,
|
|
'user_id' => $apply['user_id'],
|
|
'create_id' => session('admin_auth.aid'),
|
|
'create_type' => 1,
|
|
'create_time' => time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
$jf_data['c_proof_of_payment_url']="";
|
|
Db::name('cult4apply')->where('apply_id',$apply_id)->update($jf_data);
|
|
|
|
}elseif($status==41){
|
|
$advi= input('advice');
|
|
//需要上传的文件
|
|
$unpassfiles=get_unuploadfiles($apply_id,$status,6);
|
|
$has_send=[];
|
|
foreach ($unpassfiles as $v){
|
|
if($v['upload_role_type']==1){
|
|
$to_uids=[];
|
|
if($v['upload_role_id']==1){
|
|
//基础会员 挂牌会员
|
|
$to_uids[]=$apply['user_id'];
|
|
}elseif ($v['upload_role_id']==3){
|
|
//专家会员
|
|
$to_uids=Db::name('cult4proassign')->where(['assign_type'=>0,'apply_id'=>$apply_id,'del_flag'=>0])->column('user_id');
|
|
}elseif ($v['upload_role_id']==4){
|
|
//推荐会员
|
|
$to_uids[]=$baseinfo['member_recmd'];
|
|
}
|
|
if($to_uids){
|
|
foreach ($to_uids as $to_uid){
|
|
//未推送过
|
|
if($to_uid && !in_array($to_uid,$has_send)){
|
|
//补交材料,回到前台补交资料
|
|
$notice_title='【'.$baseinfo_name.'】申请缴费确认不通过,请补充资料!';
|
|
$notice='您(或您关联)的【'.$baseinfo_name.'】申请缴费确认不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_upcheck',['apply_id'=>$apply_id]).'">补充资料</a>反驳意见:'.$advi.'';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$to_uid,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
$has_send[]=$to_uid;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if($v['upload_role_type2']==1){
|
|
$to_uids=[];
|
|
if($v['upload_role_id2']==1){
|
|
//基础会员 挂牌会员
|
|
$to_uids[]=$apply['user_id'];
|
|
}elseif ($v['upload_role_id2']==3){
|
|
//专家会员
|
|
$to_uids=Db::name('cult4proassign')->where(['assign_type'=>0,'apply_id'=>$apply_id,'del_flag'=>0])->column('user_id');
|
|
}elseif ($v['upload_role_id2']==4){
|
|
//推荐会员
|
|
$to_uids[]=$baseinfo['member_recmd'];
|
|
}
|
|
if($to_uids){
|
|
foreach ($to_uids as $to_uid){
|
|
//未推送过
|
|
if($to_uid && !in_array($to_uid,$has_send)){
|
|
//补交材料,回到前台补交资料
|
|
$notice_title='【'.$baseinfo_name.'】申请缴费确认不通过,请补充资料!';
|
|
$notice='您(或您关联)的【'.$baseinfo_name.'】申请缴费确认不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_upcheck',['apply_id'=>$apply_id]).'">补充资料</a>反驳意见:'.$advi.'';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$to_uid,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
$has_send[]=$to_uid;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 提交事务
|
|
Db::commit();
|
|
} catch (\Exception $e) {
|
|
// 回滚事务
|
|
Db::rollback();
|
|
$this->error('缴费确认审核失败');
|
|
}
|
|
$this->success('缴费确认审核成功',url('cult4/Cult4/apply_list6'));
|
|
}
|
|
}
|
|
/*
|
|
* 专家评分中(专家已分配):15
|
|
* 专家评分中(联席会已复议):23
|
|
*/
|
|
public function apply_runcheck8(){
|
|
//本处理对应状态
|
|
$chkStatusArray = array(15, 23);
|
|
$apply_id=input('apply_id');
|
|
$curStatus=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
$user_id=session('admin_auth.aid');
|
|
//权限检查
|
|
$chkStatus=0;
|
|
foreach ($chkStatusArray as $v) {
|
|
if(check_cult4UserRight($apply_id,$user_id,$v)!=0){
|
|
$chkStatus=$v;
|
|
break;
|
|
}
|
|
}
|
|
if($chkStatus==0)$this->error('无权限',url('admin/Index/index'));
|
|
|
|
if (!request()->isAjax()){
|
|
$this->error('提交方式不正确');
|
|
}else {
|
|
//是否已分配专家
|
|
$status=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if($status==14){
|
|
$this->error('请先分配专家!');
|
|
}
|
|
|
|
//是否已提交了专家评分
|
|
$whereCnt['apply_id']=array('eq', $apply_id);
|
|
$whereCnt['del_flag']=array('eq', 0);
|
|
$whereCnt['score']=array('eq', 0);
|
|
$assignCnt = Db()->name('cult4proassign')->where($whereCnt)->count();
|
|
if($assignCnt>0){
|
|
$this->error('请代替专家进行评分及录入审核意见!');
|
|
}
|
|
|
|
//下面相关业务代码
|
|
if(input('submitType')==1) {
|
|
$status = 16;//联席会审核中(已确认专家审核):16
|
|
}elseif(input('submitType')==2) {
|
|
$status = 18;//挂牌会员修改中(确认专家审核未通过):18
|
|
}elseif(input('submitType')==3){
|
|
$status = 17;//上报中(专家审核未通过):17
|
|
}elseif(input('submitType')==4){
|
|
$status = 42;//补交材料中(确认专家审核未通过):42
|
|
}
|
|
$passStatus=16;
|
|
$reuploadStatus=42;
|
|
if(config('cult4advice.checkpro')==1)
|
|
{
|
|
if(input('advice')=='')
|
|
{
|
|
$this->error('请输入专家审核意见!');
|
|
}
|
|
}
|
|
|
|
//取得基础数据
|
|
$apply=Db::name('cult4apply')->find($apply_id);
|
|
$baseinfo=Db::name('cult4baseinfo')->find(input('base_id'));
|
|
|
|
//固定文件审核通过并且所有模板文件与文件数量对应
|
|
if( count(get_unuploadfiles($apply_id,-1,8)) > 0) {
|
|
if($status==$passStatus)
|
|
$this->error('如果文件已经审核完成,请点击补交材料!如果文件未提交或未审核,请先审核或上传文件!');
|
|
if($status==$reuploadStatus){
|
|
$rst=get_unuploadfiles($apply_id,$status,8,-1,1);
|
|
//查看是否有推荐机构上传资料
|
|
$rst2=get_unuploadfiles($apply_id,$status,8,-1,4);
|
|
if(count($rst)==0) {
|
|
if(count($rst2)>0) {
|
|
if(!$baseinfo['member_recmd']){
|
|
$this->error('未关联推荐机构,请代推荐机构添加要补交的材料!');
|
|
}
|
|
}else{
|
|
$this->error('请添加要补交的材料,或者选择要重新审核的材料!');
|
|
}
|
|
}
|
|
}
|
|
}else{
|
|
if($status==$reuploadStatus)
|
|
$this->error('请添加要补交的材料,或者选择要重新审核的材料!');
|
|
}
|
|
|
|
//防止重复提交
|
|
if (!checkToken(input('TOKEN'))) {
|
|
return;
|
|
}
|
|
|
|
Db::startTrans();
|
|
|
|
try{
|
|
//更新复审表cult4checkpro
|
|
$sl_data['apply_id']=$apply_id;
|
|
$sl_data['advice'] = input('advice',"未填写");
|
|
$sl_data['create_id']=$user_id;
|
|
$sl_data['create_time']=time();
|
|
|
|
//找到当前最大addorder
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
);
|
|
$check=Db::name('cult4checkpro')->where($where)->order('addorder desc') ->find ();
|
|
if(!empty($check)){
|
|
$sl_data['addorder']=$check['addorder']+1;
|
|
}else{
|
|
$sl_data['addorder']=0;
|
|
}
|
|
Db::name('cult4checkpro')->insert($sl_data);
|
|
|
|
//更新基本信息表为已审核cult4baseinfo
|
|
$sl_data2['base_id']=input('base_id');
|
|
$sl_data2['flag']=1;
|
|
$where2=array(
|
|
'base_id'=>input('base_id'),
|
|
);
|
|
Db::name('cult4baseinfo')->where($where2)->update($sl_data2);
|
|
|
|
//更新主表cult4apply
|
|
$sl_data3['apply_id']=$apply_id;
|
|
$sl_data3['status']=$status;
|
|
$sl_data3['update_user_id']=$user_id;
|
|
$sl_data3['update_user_type']=2;//后台
|
|
$sl_data3['update_time']=time();
|
|
$sl_data3['apply_admin_id']=0;
|
|
$where3=array(
|
|
'apply_id'=>$apply_id,
|
|
'status'=>$chkStatus,//array(array('eq',1),array('eq',$admin_id),'or')
|
|
);
|
|
Db::name('cult4apply')->where($where3)->update($sl_data3);
|
|
|
|
//更新文件表当前所有未通过的记录为历史记录,上传人需要重新上传
|
|
if($status==$reuploadStatus){
|
|
$where4=array(
|
|
'apply_id'=>$apply_id,
|
|
'new_flag'=>1,//当前最新记录
|
|
'flag'=>0,//未审核通过
|
|
);
|
|
$sl_data4['new_flag']=0;
|
|
Db::name('cult4upfiles')->where($where4)->update($sl_data4);
|
|
}
|
|
/**
|
|
* 增加通知推送,by rainfer
|
|
*/
|
|
//审核不通过时,推送通知
|
|
if($status==18 || $status==42){
|
|
if($baseinfo['apply_type']==1){
|
|
$baseinfo_name=$baseinfo['c_name'];
|
|
}elseif ($baseinfo['apply_type']==2){
|
|
$baseinfo_name=$baseinfo['p_name'];
|
|
}else{
|
|
$baseinfo_name=$baseinfo['t_apply_username'];
|
|
}
|
|
if($status==18){
|
|
//审核不通过,回到修改中,由会员前台重写修改提交
|
|
$notice_title='【'.$baseinfo_name.'】申请专家审核不通过!';
|
|
$notice='您的【'.$baseinfo_name.'】申请专家审核不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_editcheck',['apply_id'=>$apply_id]).'">修改材料</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$apply['user_id'],
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
}elseif($status==42){
|
|
//需要上传的文件
|
|
$unpassfiles=get_unuploadfiles($apply_id,$status,8);
|
|
$has_send=[];
|
|
foreach ($unpassfiles as $v){
|
|
if($v['upload_role_type']==1){
|
|
$to_uids=[];
|
|
if($v['upload_role_id']==1){
|
|
//基础会员 挂牌会员
|
|
$to_uids[]=$apply['user_id'];
|
|
}elseif ($v['upload_role_id']==3){
|
|
//专家会员
|
|
$to_uids=Db::name('cult4proassign')->where(['assign_type'=>0,'apply_id'=>$apply_id,'del_flag'=>0])->column('user_id');
|
|
}elseif ($v['upload_role_id']==4){
|
|
//推荐会员
|
|
$to_uids[]=$baseinfo['member_recmd'];
|
|
}
|
|
if($to_uids){
|
|
foreach ($to_uids as $to_uid){
|
|
//未推送过
|
|
if($to_uid && !in_array($to_uid,$has_send)){
|
|
//补交材料,回到前台补交资料
|
|
$notice_title='【'.$baseinfo_name.'】申请专家审核不通过,请补充资料!';
|
|
$notice='您(或您关联)的【'.$baseinfo_name.'】申请专家审核不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_upcheck',['apply_id'=>$apply_id]).'">补充资料</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$to_uid,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
$has_send[]=$to_uid;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if($v['upload_role_type2']==1){
|
|
$to_uids=[];
|
|
if($v['upload_role_id2']==1){
|
|
//基础会员 挂牌会员
|
|
$to_uids[]=$apply['user_id'];
|
|
}elseif ($v['upload_role_id2']==3){
|
|
//专家会员
|
|
$to_uids=Db::name('cult4proassign')->where(['assign_type'=>0,'apply_id'=>$apply_id,'del_flag'=>0])->column('user_id');
|
|
}elseif ($v['upload_role_id2']==4){
|
|
//推荐会员
|
|
$to_uids[]=$baseinfo['member_recmd'];
|
|
}
|
|
if($to_uids){
|
|
foreach ($to_uids as $to_uid){
|
|
//未推送过
|
|
if($to_uid && !in_array($to_uid,$has_send)){
|
|
//补交材料,回到前台补交资料
|
|
$notice_title='【'.$baseinfo_name.'】申请专家审核不通过,请补充资料!';
|
|
$notice='您(或您关联)的【'.$baseinfo_name.'】申请专家审核不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_upcheck',['apply_id'=>$apply_id]).'">补充资料</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$to_uid,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
$has_send[]=$to_uid;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 提交事务
|
|
Db::commit();
|
|
} catch (\Exception $e) {
|
|
// 回滚事务
|
|
Db::rollback();
|
|
$this->error('专家审核确认失败');
|
|
}
|
|
$this->success('专家审核确认成功',url('cult4/Cult4/apply_list8'));
|
|
}
|
|
}
|
|
/*
|
|
* 联席会审核中(已确认专家审核):16
|
|
*/
|
|
public function apply_runcheck9(){
|
|
//本处理对应状态
|
|
$chkStatusArray = array(16, 4, 34, 8, 11, 13, 17, 28);
|
|
$apply_id=input('apply_id');
|
|
$curStatus=Db::name('cult4apply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
$user_id=session('admin_auth.aid');
|
|
//权限检查
|
|
$chkStatus=0;
|
|
foreach ($chkStatusArray as $v) {
|
|
if(check_cult4UserRight($apply_id,$user_id,$v)!=0){
|
|
$chkStatus=$v;
|
|
break;
|
|
}
|
|
}
|
|
if($chkStatus==0)$this->error('无权限',url('admin/Index/index'));
|
|
|
|
if (!request()->isAjax()){
|
|
$this->error('提交方式不正确');
|
|
}else {
|
|
//下面相关业务代码
|
|
if(input('submitType')==1) {//审核通过
|
|
$status = 25;//材料核实中(联席会审核通过):25
|
|
}elseif(input('submitType')==2) {//审核不通过
|
|
$status = 26;//挂牌会员修改中(联席会审核未通过):26
|
|
}elseif(input('submitType')==3){//申请失败
|
|
$status = 24;//申请失败(已驳回):24
|
|
}elseif(input('submitType')==4){//补交材料
|
|
$status = 43;//补交材料中(联席会审核未通过):43
|
|
}elseif(input('submitType')==5) {//上报驳回
|
|
if($curStatus==4){
|
|
//上报中(初审未通过):4
|
|
$status=19;//初审中(联席会已复议):19
|
|
}elseif($curStatus==34){
|
|
//上报中(尽调未通过):34
|
|
$status=36;//尽调中(联席会已复议):36
|
|
}elseif($curStatus==8){
|
|
//上报中(复审未通过):8
|
|
$status=20;//复审中(联席会已复议):20
|
|
}elseif($curStatus==11){
|
|
//上报中(风控审核未通过):11
|
|
$status=21;//风控审核中(联席会已复议):21
|
|
}elseif($curStatus==13){
|
|
//上报中(未缴费未通过):13
|
|
$status=22;//缴费中(联席会已复议):22
|
|
}elseif($curStatus==17){
|
|
//上报中(专家审核未通过):17
|
|
$status=23;//专家评分中(联席会已复议):23
|
|
}elseif($curStatus==28){
|
|
//上报中(材料核实未通过):28
|
|
$status=46;//材料核实中(联席会已复议):46
|
|
}
|
|
}
|
|
$passStatus=25;
|
|
$reuploadStatus=43;
|
|
|
|
//joint conference
|
|
if(config('cult4advice.checkjc')==1)
|
|
{
|
|
if(input('advice')=='')
|
|
{
|
|
$this->error('请输入联席会审核意见!');
|
|
}
|
|
}
|
|
|
|
//取得基础数据
|
|
$apply=Db::name('cult4apply')->find($apply_id);
|
|
$baseinfo=Db::name('cult4baseinfo')->find(input('base_id'));
|
|
|
|
//固定文件审核通过并且所有模板文件与文件数量对应
|
|
if( count(get_unuploadfiles($apply_id,-1,9)) > 0) {
|
|
if($status==$passStatus)
|
|
$this->error('如果文件已经审核完成,请点击补交材料!如果文件未提交或未审核,请先审核或上传文件!');
|
|
if($status==$reuploadStatus){
|
|
$rst=get_unuploadfiles($apply_id,$status,9,-1,1);
|
|
//查看是否有推荐机构上传资料
|
|
$rst2=get_unuploadfiles($apply_id,$status,9,-1,4);
|
|
if(count($rst)==0) {
|
|
if(count($rst2)>0) {
|
|
if(!$baseinfo['member_recmd']){
|
|
$this->error('未关联推荐机构,请代推荐机构添加要补交的材料!');
|
|
}
|
|
}else{
|
|
$this->error('请添加要补交的材料,或者选择要重新审核的材料!');
|
|
}
|
|
}
|
|
}
|
|
}else{
|
|
if($status==$reuploadStatus)
|
|
$this->error('请添加要补交的材料,或者选择要重新审核的材料!');
|
|
}
|
|
|
|
//防止重复提交
|
|
if (!checkToken(input('TOKEN'))) {
|
|
$this->error('提交失败');
|
|
}
|
|
|
|
Db::startTrans();
|
|
|
|
try{
|
|
//更新复审表cult4checkpro
|
|
$sl_data['apply_id']=$apply_id;
|
|
$sl_data['advice'] = input('advice',"未填写");
|
|
$sl_data['create_id']=$user_id;
|
|
$sl_data['create_time']=time();
|
|
|
|
//找到当前最大addorder
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
);
|
|
$check=Db::name('cult4checkjc')->where($where)->order('addorder desc') ->find ();
|
|
if(!empty($check)){
|
|
$sl_data['addorder']=$check['addorder']+1;
|
|
}else{
|
|
$sl_data['addorder']=0;
|
|
}
|
|
Db::name('cult4checkjc')->insert($sl_data);
|
|
|
|
//更新基本信息表为已审核cult4baseinfo
|
|
$sl_data2['base_id']=input('base_id');
|
|
$sl_data2['flag']=1;
|
|
$where2=array(
|
|
'base_id'=>input('base_id'),
|
|
);
|
|
Db::name('cult4baseinfo')->where($where2)->update($sl_data2);
|
|
|
|
//更新主表cult4apply
|
|
$sl_data3['apply_id']=$apply_id;
|
|
$sl_data3['status']=$status;
|
|
$sl_data3['update_user_id']=$user_id;
|
|
$sl_data3['update_user_type']=2;//后台
|
|
$sl_data3['update_time']=time();
|
|
$sl_data3['apply_admin_id']=0;
|
|
$where3=array(
|
|
'apply_id'=>$apply_id,
|
|
'status'=>$chkStatus,//array(array('eq',1),array('eq',$admin_id),'or')
|
|
);
|
|
Db::name('cult4apply')->where($where3)->update($sl_data3);
|
|
|
|
//更新文件表当前所有未通过的记录为历史记录,上传人需要重新上传
|
|
if($status==$reuploadStatus){
|
|
$where4=array(
|
|
'apply_id'=>$apply_id,
|
|
'new_flag'=>1,//当前最新记录
|
|
'flag'=>0,//未审核通过
|
|
);
|
|
$sl_data4['new_flag']=0;
|
|
Db::name('cult4upfiles')->where($where4)->update($sl_data4);
|
|
}
|
|
/**
|
|
* 增加通知推送,by rainfer
|
|
*/
|
|
//审核不通过时,推送通知
|
|
if($status==26 || $status==43){
|
|
if($baseinfo['apply_type']==1){
|
|
$baseinfo_name=$baseinfo['c_name'];
|
|
}elseif ($baseinfo['apply_type']==2){
|
|
$baseinfo_name=$baseinfo['p_name'];
|
|
}else{
|
|
$baseinfo_name=$baseinfo['t_apply_username'];
|
|
}
|
|
if($status==26){
|
|
//审核不通过,回到修改中,由会员前台重写修改提交
|
|
$notice_title='【'.$baseinfo_name.'】申请联席会审核不通过!';
|
|
$notice='您的【'.$baseinfo_name.'】申请联席会审核不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_editcheck',['apply_id'=>$apply_id]).'">修改材料</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$apply['user_id'],
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
}elseif($status==43){
|
|
//需要上传的文件
|
|
$unpassfiles=get_unuploadfiles($apply_id,$status,9);
|
|
$has_send=[];
|
|
foreach ($unpassfiles as $v){
|
|
if($v['upload_role_type']==1){
|
|
$to_uids=[];
|
|
if($v['upload_role_id']==1){
|
|
//基础会员 挂牌会员
|
|
$to_uids[]=$apply['user_id'];
|
|
}elseif ($v['upload_role_id']==3){
|
|
//专家会员
|
|
$to_uids=Db::name('cult4proassign')->where(['assign_type'=>0,'apply_id'=>$apply_id,'del_flag'=>0])->column('user_id');
|
|
}elseif ($v['upload_role_id']==4){
|
|
//推荐会员
|
|
$to_uids[]=$baseinfo['member_recmd'];
|
|
}
|
|
if($to_uids){
|
|
foreach ($to_uids as $to_uid){
|
|
//未推送过
|
|
if($to_uid && !in_array($to_uid,$has_send)){
|
|
//补交材料,回到前台补交资料
|
|
$notice_title='【'.$baseinfo_name.'】申请联席会审核不通过,请补充资料!';
|
|
$notice='您(或您关联)的【'.$baseinfo_name.'】申请联席会审核不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_upcheck',['apply_id'=>$apply_id]).'">补充资料</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$to_uid,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
$has_send[]=$to_uid;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if($v['upload_role_type2']==1){
|
|
$to_uids=[];
|
|
if($v['upload_role_id2']==1){
|
|
//基础会员 挂牌会员
|
|
$to_uids[]=$apply['user_id'];
|
|
}elseif ($v['upload_role_id2']==3){
|
|
//专家会员
|
|
$to_uids=Db::name('cult4proassign')->where(['assign_type'=>0,'apply_id'=>$apply_id,'del_flag'=>0])->column('user_id');
|
|
}elseif ($v['upload_role_id2']==4){
|
|
//推荐会员
|
|
$to_uids[]=$baseinfo['member_recmd'];
|
|
}
|
|
if($to_uids){
|
|
foreach ($to_uids as $to_uid){
|
|
//未推送过
|
|
if($to_uid && !in_array($to_uid,$has_send)){
|
|
//补交材料,回到前台补交资料
|
|
$notice_title='【'.$baseinfo_name.'】申请联席会审核不通过,请补充资料!';
|
|
$notice='您(或您关联)的【'.$baseinfo_name.'】申请联席会审核不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_upcheck',['apply_id'=>$apply_id]).'">补充资料</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$to_uid,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
$has_send[]=$to_uid;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 提交事务
|
|
Db::commit();
|
|
} catch (\Exception $e) {
|
|
// 回滚事务
|
|
Db::rollback();
|
|
$this->error('联席会审核确认失败');
|
|
}
|
|
$this->success('联席会审核确认成功',url('cult4/Cult4/apply_list9'));
|
|
}
|
|
}
|
|
|
|
/*
|
|
* 材料核实中(联席会审核通过):25
|
|
* 材料核实中(联席会已复议):46
|
|
* 材料核实中(保存核实意见):47
|
|
*/
|
|
public function apply_runcheck10(){
|
|
if(input('submitType')==6){
|
|
$this->success('执行返回操作',url('cult4/Cult4/apply_list10'));
|
|
}
|
|
|
|
//本处理对应状态
|
|
$chkStatusArray = array(25, 46, 47);
|
|
$apply_id=input('apply_id');
|
|
$user_id=session('admin_auth.aid');
|
|
//权限检查
|
|
$chkStatus=0;
|
|
foreach ($chkStatusArray as $v) {
|
|
if(check_cult4UserRight($apply_id,$user_id,$v)!=0){
|
|
$chkStatus=$v;
|
|
break;
|
|
}
|
|
}
|
|
if($chkStatus==0)$this->error('无权限',url('admin/Index/index'));
|
|
|
|
if (!request()->isAjax()){
|
|
$this->error('提交方式不正确');
|
|
}else {
|
|
//下面相关业务代码
|
|
if(input('submitType')==1) {
|
|
$status = 27;//公告资料提交中(材料核实通过):27
|
|
$btnid = 0;
|
|
}elseif(input('submitType')==2){
|
|
$status = 44;//挂牌会员修改中(材料核实未通过):44
|
|
$btnid = 1;
|
|
}elseif(input('submitType')==3){
|
|
$status = 28;//上报中(材料核实未通过):28
|
|
$btnid = 2;
|
|
}elseif(input('submitType')==4){
|
|
$status = 45;//补交材料中(材料核实未通过):45
|
|
$btnid = 3;
|
|
}elseif(input('submitType')==5){
|
|
$status = 47;//材料核实中(保存核实意见):47
|
|
$btnid = 4;
|
|
}
|
|
$passStatus=27;
|
|
$reuploadStatus=45;
|
|
if(config('cult4advice.checkmc')==1)
|
|
{
|
|
if(input('advice')=='')
|
|
{
|
|
$this->error('请输入材料核实意见!');
|
|
}
|
|
}
|
|
|
|
//取得基础数据
|
|
$apply=Db::name('cult4apply')->find($apply_id);
|
|
$baseinfo=Db::name('cult4baseinfo')->find(input('base_id'));
|
|
|
|
//固定文件审核通过并且所有模板文件与文件数量对应
|
|
if( count(get_unuploadfiles($apply_id,-1,10)) > 0) {
|
|
if($status==$passStatus)
|
|
$this->error('如果文件已经审核完成,请点击补交材料!如果文件未提交或未审核,请先审核或上传文件!');
|
|
if($status==$reuploadStatus){
|
|
$rst=get_unuploadfiles($apply_id,$status,10,-1,1);
|
|
//查看是否有推荐机构上传资料
|
|
$rst2=get_unuploadfiles($apply_id,$status,10,-1,4);
|
|
if(count($rst)==0) {
|
|
if(count($rst2)>0) {
|
|
if(!$baseinfo['member_recmd']){
|
|
$this->error('未关联推荐机构,请代推荐机构添加要补交的材料!');
|
|
}
|
|
}else{
|
|
$this->error('请添加要补交的材料,或者选择要重新审核的材料!');
|
|
}
|
|
}
|
|
}
|
|
}else{
|
|
if($status==$reuploadStatus)
|
|
$this->error('请添加要补交的材料,或者选择要重新审核的材料!');
|
|
}
|
|
|
|
//防止重复提交
|
|
if (!checkToken(input('TOKEN'))) {
|
|
return;
|
|
}
|
|
|
|
Db::startTrans();
|
|
|
|
try{
|
|
//更新复审表cult4checkreview
|
|
$sl_data['apply_id']=$apply_id;
|
|
$sl_data['advice'] = input('advice',"未填写");
|
|
$sl_data['btnid'] = $btnid;
|
|
$sl_data['create_id']=$user_id;
|
|
$sl_data['create_time']=time();
|
|
|
|
//找到当前最大addorder
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
);
|
|
$check=Db::name('cult4checkmc')->where($where)->order('addorder desc') ->find ();
|
|
if(!empty($check)){
|
|
$sl_data['addorder']=$check['addorder']+1;
|
|
}else{
|
|
$sl_data['addorder']=0;
|
|
}
|
|
Db::name('cult4checkmc')->insert($sl_data);
|
|
|
|
//更新基本信息表为已审核cult4baseinfo
|
|
$sl_data2['base_id']=input('base_id');
|
|
$sl_data2['flag']=1;
|
|
$where2=array(
|
|
'base_id'=>input('base_id'),
|
|
);
|
|
Db::name('cult4baseinfo')->where($where2)->update($sl_data2);
|
|
|
|
//更新主表cult4apply
|
|
$sl_data3['apply_id']=$apply_id;
|
|
$sl_data3['status']=$status;
|
|
$sl_data3['update_user_id']=$user_id;
|
|
$sl_data3['update_user_type']=2;//后台
|
|
$sl_data3['update_time']=time();
|
|
$sl_data3['apply_admin_id']=0;
|
|
$where3=array(
|
|
'apply_id'=>$apply_id,
|
|
'status'=>$chkStatus,//array(array('eq',1),array('eq',$admin_id),'or')
|
|
);
|
|
Db::name('cult4apply')->where($where3)->update($sl_data3);
|
|
|
|
//更新文件表当前所有未通过的记录为历史记录,上传人需要重新上传
|
|
if($status==$reuploadStatus){
|
|
$where4=array(
|
|
'apply_id'=>$apply_id,
|
|
'new_flag'=>1,//当前最新记录
|
|
'flag'=>0,//未审核通过
|
|
);
|
|
$sl_data4['new_flag']=0;
|
|
Db::name('cult4upfiles')->where($where4)->update($sl_data4);
|
|
}
|
|
/**
|
|
* 增加通知推送,by rainfer
|
|
*/
|
|
//审核不通过时,推送通知
|
|
if($status==44 || $status==45){
|
|
if($baseinfo['apply_type']==1){
|
|
$baseinfo_name=$baseinfo['c_name'];
|
|
}elseif ($baseinfo['apply_type']==2){
|
|
$baseinfo_name=$baseinfo['p_name'];
|
|
}else{
|
|
$baseinfo_name=$baseinfo['t_apply_username'];
|
|
}
|
|
if($status==44){
|
|
//审核不通过,回到修改中,由会员前台重写修改提交
|
|
$notice_title='【'.$baseinfo_name.'】申请材料核实不通过!';
|
|
$notice='您的【'.$baseinfo_name.'】申请材料核实不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_editcheck',['apply_id'=>$apply_id]).'">修改材料</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$apply['user_id'],
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
}elseif($status==45){
|
|
//需要上传的文件
|
|
$unpassfiles=get_unuploadfiles($apply_id,$status,10);
|
|
$has_send=[];
|
|
foreach ($unpassfiles as $v){
|
|
if($v['upload_role_type']==1){
|
|
$to_uids=[];
|
|
if($v['upload_role_id']==1){
|
|
//基础会员 挂牌会员
|
|
$to_uids[]=$apply['user_id'];
|
|
}elseif ($v['upload_role_id']==3){
|
|
//专家会员
|
|
$to_uids=Db::name('cult4proassign')->where(['assign_type'=>0,'apply_id'=>$apply_id,'del_flag'=>0])->column('user_id');
|
|
}elseif ($v['upload_role_id']==4){
|
|
//推荐会员
|
|
$to_uids[]=$baseinfo['member_recmd'];
|
|
}
|
|
if($to_uids){
|
|
foreach ($to_uids as $to_uid){
|
|
//未推送过
|
|
if($to_uid && !in_array($to_uid,$has_send)){
|
|
//补交材料,回到前台补交资料
|
|
$notice_title='【'.$baseinfo_name.'】申请材料核实不通过,请补充资料!';
|
|
$notice='您(或您关联)的【'.$baseinfo_name.'】申请材料核实不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_upcheck',['apply_id'=>$apply_id]).'">补充资料</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$to_uid,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
$has_send[]=$to_uid;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if($v['upload_role_type2']==1){
|
|
$to_uids=[];
|
|
if($v['upload_role_id2']==1){
|
|
//基础会员 挂牌会员
|
|
$to_uids[]=$apply['user_id'];
|
|
}elseif ($v['upload_role_id2']==3){
|
|
//专家会员
|
|
$to_uids=Db::name('cult4proassign')->where(['assign_type'=>0,'apply_id'=>$apply_id,'del_flag'=>0])->column('user_id');
|
|
}elseif ($v['upload_role_id2']==4){
|
|
//推荐会员
|
|
$to_uids[]=$baseinfo['member_recmd'];
|
|
}
|
|
if($to_uids){
|
|
foreach ($to_uids as $to_uid){
|
|
//未推送过
|
|
if($to_uid && !in_array($to_uid,$has_send)){
|
|
//补交材料,回到前台补交资料
|
|
$notice_title='【'.$baseinfo_name.'】申请材料核实不通过,请补充资料!';
|
|
$notice='您(或您关联)的【'.$baseinfo_name.'】申请材料核实不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_upcheck',['apply_id'=>$apply_id]).'">补充资料</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$to_uid,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
$has_send[]=$to_uid;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}elseif($status==27){//公告资料提交中(材料核实通过):27
|
|
$baseinfo=Db::name('cult4baseinfo')->find(input('base_id'));
|
|
$apply=Db::name('cult4apply')->find($apply_id);
|
|
if($baseinfo['apply_type']==1){
|
|
$baseinfo_name=$baseinfo['c_name'];
|
|
}elseif ($baseinfo['apply_type']==2){
|
|
$baseinfo_name=$baseinfo['p_name'];
|
|
}else{
|
|
$baseinfo_name=$baseinfo['t_apply_username'];
|
|
}
|
|
//审核不通过,回到修改中,由会员前台重写修改提交
|
|
$notice_title='【'.$baseinfo_name.'】申请材料核实已通过,需要您提供以下内容!';
|
|
$notice='您的【'.$baseinfo_name.'】申请材料核实已通过,需要您提供挂牌信息或上传挂牌资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_editcode',['apply_id'=>$apply_id]).'">提交材料</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$apply['user_id'],
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
}
|
|
// 提交事务
|
|
Db::commit();
|
|
} catch (\Exception $e) {
|
|
// 回滚事务
|
|
Db::rollback();
|
|
$this->error('材料核实失败');
|
|
}
|
|
$this->success('材料核实成功',url('cult4/Cult4/apply_list10'));
|
|
}
|
|
}
|
|
/*
|
|
* 公告资料提交对应的挂牌代码录入
|
|
*/
|
|
public function apply_runaddcode()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$user_id=session('admin_auth.aid');
|
|
$chkStatusArray = array(48);//源代码48
|
|
//权限检查
|
|
$chkStatus=0;
|
|
foreach ($chkStatusArray as $v) {
|
|
if(check_cult4UserRight($apply_id,$user_id,$v)!=0){
|
|
$chkStatus=$v;
|
|
break;
|
|
}
|
|
}
|
|
if($chkStatus==0)$this->error('无权限',url('home/Listn/ts_insert_hm#nm',array('apply_id'=>$apply_id,'snd'=>rand(10000,99999))));
|
|
|
|
|
|
$code=input('code');
|
|
if(empty($code)){
|
|
$this->error('请输入挂牌代码!',url('cult4/Cult4/apply_check11#nm',array('apply_id'=>$apply_id,'snd'=>rand(10000,99999))));
|
|
}
|
|
|
|
$codename=input('codename');
|
|
if(empty($codename)){
|
|
$this->error('请输入挂牌名称!',url('cult4/Cult4/apply_check11#nm',array('apply_id'=>$apply_id,'snd'=>rand(10000,99999))));
|
|
}
|
|
|
|
$status = 29;//公告资料审核中(公告资料已提交):29
|
|
|
|
//防止重复提交
|
|
if (!checkToken(input('TOKEN'))) {
|
|
return;
|
|
}
|
|
|
|
Db::startTrans();
|
|
|
|
try{
|
|
//更新基本信息表为已审核cult4baseinfo
|
|
$sl_data2['base_id']=input('base_id');
|
|
$sl_data2['apply_id']=input('apply_id');
|
|
$sl_data2['code']=$code;
|
|
$sl_data2['codename']=$codename;
|
|
$sl_data2['code_oper_id']=$user_id;
|
|
$sl_data2['code_oper_type']=2;//后台
|
|
$sl_data2['code_oper_time']=time();
|
|
$where2=array(
|
|
'base_id'=>input('base_id'),
|
|
);
|
|
Db::name('cult4baseinfo')->where($where2)->update($sl_data2);
|
|
|
|
//更新主表cult4apply
|
|
$sl_data3['apply_id']=$apply_id;
|
|
$sl_data3['status']=$status;
|
|
$sl_data3['update_user_id']=$user_id;
|
|
$sl_data3['update_user_type']=2;//后台
|
|
$sl_data3['update_time']=time();
|
|
//$sl_data3['apply_admin_id']=0;//还由本人操作
|
|
$where3=array(
|
|
'apply_id'=>$apply_id,
|
|
'status'=>$chkStatus,
|
|
);
|
|
Db::name('cult4apply')->where($where3)->update($sl_data3);
|
|
|
|
//更新文件表当前所有未通过的记录为历史记录,上传人需要重新上传
|
|
if(config('cult4files.checknm')==1){
|
|
$where4=array(
|
|
'apply_id'=>$apply_id,
|
|
'new_flag'=>1,//当前最新记录
|
|
'flag'=>0,//未审核通过
|
|
);
|
|
$sl_data4['new_flag']=0;
|
|
Db::name('cult4upfiles')->where($where4)->update($sl_data4);
|
|
}
|
|
// 提交事务
|
|
Db::commit();
|
|
} catch (\Exception $e) {
|
|
// 回滚事务
|
|
Db::rollback();
|
|
$this->error('挂牌资料录入失败',url('cult4/Cult4/apply_check11#nm',array('apply_id'=>$apply_id,'snd'=>rand(10000,99999))));
|
|
}
|
|
$this->success('挂牌资料录入成功',url('cult4/Cult4/apply_check11#nm',array('apply_id'=>$apply_id,'snd'=>rand(10000,99999))));
|
|
}
|
|
/*
|
|
* 公告资料提交中(已提交基础信息):48
|
|
* 公告资料审核中(公告资料已提交):29
|
|
*/
|
|
public function apply_runcheck11(){
|
|
//本处理对应状态
|
|
$chkStatusArray = array(29);
|
|
$apply_id=input('apply_id');
|
|
$user_id=session('admin_auth.aid');
|
|
//权限检查
|
|
$chkStatus=0;
|
|
foreach ($chkStatusArray as $v) {
|
|
if(check_cult4UserRight($apply_id,$user_id,$v)!=0){
|
|
$chkStatus=$v;
|
|
break;
|
|
}
|
|
}
|
|
if($chkStatus==0)$this->error('无权限',url('admin/Index/index'));
|
|
|
|
if (!request()->isAjax()){
|
|
$this->error('提交方式不正确');
|
|
}else {
|
|
//下面相关业务代码
|
|
if(input('submitType')==1) {
|
|
$status = 30;//挂牌上市中(已提交公告资料):30
|
|
}elseif(input('submitType')==2){
|
|
$status = 49;//挂牌会员修改中(公告资料审核未通过):49
|
|
}elseif(input('submitType')==4) {
|
|
$status = 50;//补交材料中(公告资料审核未通过):50
|
|
}
|
|
$passStatus=30;
|
|
$reuploadStatus=50;
|
|
if(config('cult4advice.checknm')==1)
|
|
{
|
|
if(input('advice')=='')
|
|
{
|
|
$this->error('请输入公告材料审核意见!');
|
|
}
|
|
}
|
|
|
|
//取得基础数据
|
|
$apply=Db::name('cult4apply')->find($apply_id);
|
|
$baseinfo=Db::name('cult4baseinfo')->find(input('base_id'));
|
|
|
|
|
|
|
|
//防止重复提交
|
|
if (!checkToken(input('TOKEN'))) {
|
|
return;
|
|
}
|
|
|
|
Db::startTrans();
|
|
|
|
try{
|
|
//更新复审表cult4checkreview
|
|
$sl_data['apply_id']=$apply_id;
|
|
$sl_data['advice'] = input('advice',"未填写");
|
|
$sl_data['create_id']=$user_id;
|
|
$sl_data['create_time']=time();
|
|
|
|
//找到当前最大addorder
|
|
$where=array(
|
|
'apply_id'=>$apply_id,
|
|
);
|
|
$check=Db::name('cult4checknm')->where($where)->order('addorder desc') ->find ();
|
|
if(!empty($check)){
|
|
$sl_data['addorder']=$check['addorder']+1;
|
|
}else{
|
|
$sl_data['addorder']=0;
|
|
}
|
|
Db::name('cult4checknm')->insert($sl_data);
|
|
|
|
//更新基本信息表为已审核cult4baseinfo
|
|
$sl_data2['base_id']=input('base_id');
|
|
$sl_data2['flag']=1;
|
|
$where2=array(
|
|
'base_id'=>input('base_id'),
|
|
);
|
|
Db::name('cult4baseinfo')->where($where2)->update($sl_data2);
|
|
|
|
//更新主表cult4apply
|
|
$sl_data3['apply_id']=$apply_id;
|
|
$sl_data3['status']=$status;
|
|
$sl_data3['update_user_id']=$user_id;
|
|
$sl_data3['update_user_type']=2;//后台
|
|
$sl_data3['update_time']=time();
|
|
$sl_data3['apply_admin_id']=0;
|
|
$where3=array(
|
|
'apply_id'=>$apply_id,
|
|
'status'=>$chkStatus,
|
|
);
|
|
Db::name('cult4apply')->where($where3)->update($sl_data3);
|
|
|
|
//更新文件表当前所有未通过的记录为历史记录,上传人需要重新上传
|
|
if($status==$reuploadStatus){
|
|
$where4=array(
|
|
'apply_id'=>$apply_id,
|
|
'new_flag'=>1,//当前最新记录
|
|
'flag'=>0,//未审核通过
|
|
);
|
|
$sl_data4['new_flag']=0;
|
|
Db::name('cult4upfiles')->where($where4)->update($sl_data4);
|
|
}
|
|
/**
|
|
* 增加通知推送,by rainfer
|
|
*/
|
|
//审核不通过时,推送通知
|
|
if($baseinfo['apply_type']==1){
|
|
$baseinfo_name=$baseinfo['c_name'];
|
|
}elseif ($baseinfo['apply_type']==2){
|
|
$baseinfo_name=$baseinfo['p_name'];
|
|
}else{
|
|
$baseinfo_name=$baseinfo['t_apply_username'];
|
|
}
|
|
if($status==49 || $status==50){
|
|
if($status==49){
|
|
//审核不通过,回到修改中,由会员前台重写修改提交
|
|
$notice_title='【'.$baseinfo_name.'】申请公告材料审核不通过!';
|
|
$notice='您的【'.$baseinfo_name.'】申请公告材料审核不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_editcheck',['apply_id'=>$apply_id]).'">修改材料</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$apply['user_id'],
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
}elseif($status==50){
|
|
//需要上传的文件
|
|
$unpassfiles=get_unuploadfiles($apply_id,$status,11);
|
|
$has_send=[];
|
|
foreach ($unpassfiles as $v){
|
|
if($v['upload_role_type']==1){
|
|
$to_uids=[];
|
|
if($v['upload_role_id']==1){
|
|
//基础会员 挂牌会员
|
|
$to_uids[]=$apply['user_id'];
|
|
}elseif ($v['upload_role_id']==3){
|
|
//专家会员
|
|
$to_uids=Db::name('cult4proassign')->where(['assign_type'=>0,'apply_id'=>$apply_id,'del_flag'=>0])->column('user_id');
|
|
}elseif ($v['upload_role_id']==4){
|
|
//推荐会员
|
|
$to_uids[]=$baseinfo['member_recmd'];
|
|
}
|
|
if($to_uids){
|
|
foreach ($to_uids as $to_uid){
|
|
//未推送过
|
|
if($to_uid && !in_array($to_uid,$has_send)){
|
|
//补交材料,回到前台补交资料
|
|
$notice_title='【'.$baseinfo_name.'】申请公告材料审核不通过,请补充资料!';
|
|
$notice='您(或您关联)的【'.$baseinfo_name.'】申请公告材料审核不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_upcheck',['apply_id'=>$apply_id]).'">补充资料</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$to_uid,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
$has_send[]=$to_uid;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if($v['upload_role_type2']==1){
|
|
$to_uids=[];
|
|
if($v['upload_role_id2']==1){
|
|
//基础会员 挂牌会员
|
|
$to_uids[]=$apply['user_id'];
|
|
}elseif ($v['upload_role_id2']==3){
|
|
//专家会员
|
|
$to_uids=Db::name('cult4proassign')->where(['assign_type'=>0,'apply_id'=>$apply_id,'del_flag'=>0])->column('user_id');
|
|
}elseif ($v['upload_role_id2']==4){
|
|
//推荐会员
|
|
$to_uids[]=$baseinfo['member_recmd'];
|
|
}
|
|
if($to_uids){
|
|
foreach ($to_uids as $to_uid){
|
|
//未推送过
|
|
if($to_uid && !in_array($to_uid,$has_send)){
|
|
//补交材料,回到前台补交资料
|
|
$notice_title='【'.$baseinfo_name.'】申请公告材料审核不通过,请补充资料!';
|
|
$notice='您(或您关联)的【'.$baseinfo_name.'】申请公告材料审核不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_upcheck',['apply_id'=>$apply_id]).'">补充资料</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$to_uid,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
$has_send[]=$to_uid;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// 提交事务
|
|
Db::commit();
|
|
} catch (\Exception $e) {
|
|
// 回滚事务
|
|
Db::rollback();
|
|
$this->error('公告材料审核失败');
|
|
}
|
|
//审核通过准予挂牌上市
|
|
if($status==30) {
|
|
//准于挂牌公告
|
|
$notice_title = '【' . $baseinfo_name . '】准予挂牌上市公告!';
|
|
$notice = '您的【' . $baseinfo_name . '】申请挂牌上市申请材料已收悉。经本所风控鉴评中心、专家审核委员会、联席会议的三级审核,贵方申请的(' . $baseinfo_name . ')符合本所挂牌上市要求,现准予挂牌上市。';
|
|
$sl_data = [
|
|
'notice_title' => $notice_title,
|
|
'notice' => $notice,
|
|
'apply_id' => $apply_id,
|
|
'user_id' => $apply['user_id'],
|
|
'create_id' => session('admin_auth.aid'),
|
|
'create_type' => 1,
|
|
'create_time' => time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
|
|
$username=get_cult4UserName($apply['user_id'],1);
|
|
|
|
//特殊号码缴费通知书
|
|
if($baseinfo['codetype']==1){
|
|
$notice_title = '【' . $baseinfo_name . '】特殊号码缴费通知书!';
|
|
$contents=Options::get_options('number_options',$this->lang);
|
|
$contents['content_tpl']=isset($contents['content_tpl'])?$contents['content_tpl']:'';
|
|
$notice=$contents['content_tpl'];
|
|
$notice=str_replace('#COMNAME#',$username,$notice);
|
|
$where5=array(
|
|
'id'=>$baseinfo['code_id'],
|
|
);
|
|
$price=DB::name('cult4number')->where($where5)->value('price');
|
|
$notice=str_replace('#PRICE#',$price,$notice);
|
|
$notice=str_replace('#CODE#',$baseinfo['code'],$notice);
|
|
$notice=str_replace('#DATE#',date('Y年m月d日', time()),$notice);
|
|
$sl_data = [
|
|
'notice_title' => $notice_title,
|
|
'notice' => $notice,
|
|
'apply_id' => $apply_id,
|
|
'user_id' => $apply['user_id'],
|
|
'create_id' => session('admin_auth.aid'),
|
|
'create_type' => 1,
|
|
'create_time' => time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
}
|
|
|
|
//插入到前台公告
|
|
$this->_pushNotice($username,$baseinfo);
|
|
}
|
|
$this->success('公告材料审核成功',url('cult4/Cult4/apply_list11'));
|
|
}
|
|
}
|
|
protected function _pushNotice($username='',$baseinfo=array()){
|
|
|
|
$ctitle='企业公告';
|
|
if($baseinfo['apply_type']==1){
|
|
$baseinfo_name=$baseinfo['c_name'];
|
|
}elseif ($baseinfo['apply_type']==2){
|
|
$baseinfo_name=$baseinfo['p_name'];
|
|
$ctitle='项目公告';
|
|
}else{
|
|
$baseinfo_name=$baseinfo['t_apply_username'];
|
|
$ctitle='人才公告';
|
|
}
|
|
//插入到前台公告
|
|
$contents=Options::get_options('notice_options',$this->lang);
|
|
$contents_title='深圳文交所“文化产业板”挂牌'.$ctitle.'('.$baseinfo_name.')';
|
|
$contents['content_tpl']=isset($contents['content_tpl'])?$contents['content_tpl']:'';
|
|
$notice=$contents['content_tpl'];
|
|
$notice=str_replace('#COMNAME#',$baseinfo_name,$notice);
|
|
$notice=str_replace('#CODENAME#',$baseinfo['shortname'],$notice);
|
|
$notice=str_replace('#APPLYNAME#',$baseinfo_name,$notice);
|
|
$notice=str_replace('#CODE#',$baseinfo['code'],$notice);
|
|
$notice=str_replace('#DATE#',date('Y年m月d日', time()),$notice);
|
|
$sl_data=array(
|
|
'n_title'=>$contents_title,
|
|
'n_cid'=>1,
|
|
'n_source'=>'深圳文化产权交易所',
|
|
'n_status'=>1,
|
|
'n_desc'=>'',
|
|
'n_content'=>$notice,
|
|
'n_uid'=>session('admin_auth.aid'),
|
|
'n_time'=>time(),
|
|
'n_order'=>50,
|
|
'n_status'=>1,
|
|
'n_hits'=>200,
|
|
);
|
|
Db::name('bsgg')->insert($sl_data);
|
|
}
|
|
/*
|
|
* 挂牌上市对应的路演演讲内容录入
|
|
*/
|
|
public function apply_runaddroadshow()
|
|
{
|
|
$chkStatusArray = array(30);
|
|
$apply_id=input('apply_id');
|
|
$user_id=session('admin_auth.aid');
|
|
//权限检查
|
|
$chkStatus=0;
|
|
foreach ($chkStatusArray as $v) {
|
|
if(check_cult4UserRight($apply_id,$user_id,$v)!=0){
|
|
$chkStatus=$v;
|
|
break;
|
|
}
|
|
}
|
|
if($chkStatus==0)$this->error('无权限',url('admin/Index/index'));
|
|
|
|
$roadshow=input('myEditorRoadshow');
|
|
if(empty($roadshow)){
|
|
$this->error('请输入路演演讲内容代码!',url('cult4/Cult4/apply_check12#board',array('apply_id'=>$apply_id,'snd'=>rand(10000,99999))));
|
|
}
|
|
|
|
$status = 48;//公告资料审核中(公告资料已提交):29
|
|
|
|
//防止重复提交
|
|
if (!checkToken(input('TOKEN'))) {
|
|
return;
|
|
}
|
|
|
|
Db::startTrans();
|
|
|
|
try{
|
|
//更新基本信息表为已审核cult4baseinfo
|
|
$sl_data2['base_id']=input('base_id');
|
|
$sl_data2['apply_id']=input('apply_id');
|
|
$sl_data2['roadshow']=$roadshow;
|
|
$sl_data2['roadshow_oper_id']=$user_id;
|
|
$sl_data2['roadshow_oper_type']=2;//后台
|
|
$sl_data2['roadshow_oper_time']=time();
|
|
$where2=array(
|
|
'base_id'=>input('base_id'),
|
|
);
|
|
Db::name('cult4baseinfo')->where($where2)->update($sl_data2);
|
|
|
|
//更新主表cult4apply
|
|
$sl_data3['apply_id']=$apply_id;
|
|
$sl_data3['status']=$status;
|
|
$sl_data3['update_user_id']=$user_id;
|
|
$sl_data3['update_user_type']=2;//后台
|
|
$sl_data3['update_time']=time();
|
|
//$sl_data3['apply_admin_id']=0;//还由本人操作
|
|
$where3=array(
|
|
'apply_id'=>$apply_id,
|
|
'status'=>$chkStatus,
|
|
);
|
|
Db::name('cult4apply')->where($where3)->update($sl_data3);
|
|
|
|
$apply=Db::name('cult4apply')->find($apply_id);
|
|
$baseinfo=Db::name('cult4baseinfo')->find(input('base_id'));
|
|
|
|
/**
|
|
* 增加通知推送,by rainfer
|
|
*/
|
|
if($baseinfo['apply_type']==1){
|
|
$baseinfo_name=$baseinfo['c_name'];
|
|
}elseif ($baseinfo['apply_type']==2){
|
|
$baseinfo_name=$baseinfo['p_name'];
|
|
}else{
|
|
$baseinfo_name=$baseinfo['t_apply_username'];
|
|
}
|
|
|
|
//特殊号码缴费通知
|
|
$username=get_cult4UserName($apply['user_id'],1);
|
|
$notice_title = '【' . $baseinfo_name . '】特殊号码缴费通知!';
|
|
$contents=Options::get_options('tscheck_options',$this->lang);
|
|
$contents['content_tpl']=isset($contents['content_tpl'])?$contents['content_tpl']:'';
|
|
$notice=$contents['content_tpl'];
|
|
$notice=str_replace('#COMNAME#',$username,$notice);
|
|
$notice=str_replace('#DATE#',date('Y年m月d日', time()),$notice);
|
|
$sl_data = [
|
|
'notice_title' => $notice_title,
|
|
'notice' => $notice,
|
|
'apply_id' => $apply_id,
|
|
'user_id' => $apply['user_id'],
|
|
'create_id' => session('admin_auth.aid'),
|
|
'create_type' => 1,
|
|
'create_time' => time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
|
|
|
|
//更新文件表当前所有未通过的记录为历史记录,上传人需要重新上传
|
|
/*if(config('cult4files.checkboard')==1){
|
|
$where4=array(
|
|
'apply_id'=>$apply_id,
|
|
'new_flag'=>1,//当前最新记录
|
|
'flag'=>0,//未审核通过
|
|
);
|
|
$sl_data4['new_flag']=0;
|
|
Db::name('cult4upfiles')->where($where4)->update($sl_data4);
|
|
}*/
|
|
// 提交事务
|
|
Db::commit();
|
|
} catch (\Exception $e) {
|
|
// 回滚事务
|
|
Db::rollback();
|
|
$this->error('路演演讲内容录入失败');
|
|
}
|
|
$this->success('路演演讲内容录入成功',url('cult4/Cult4/apply_list12'));
|
|
}
|
|
/*
|
|
* 挂牌上市中(已提交公告资料):30
|
|
* 挂牌上市中(已提交路演资料):51
|
|
*/
|
|
public function apply_runcheck12(){
|
|
//本处理对应状态
|
|
$chkStatusArray = array(51,30,48);
|
|
$apply_id=input('apply_id');
|
|
$user_id=session('admin_auth.aid');
|
|
$roadshowdt=input('roadshowdt');
|
|
//权限检查
|
|
$chkStatus=0;
|
|
foreach ($chkStatusArray as $v) {
|
|
if(check_cult4UserRight($apply_id,$user_id,$v)!=0){
|
|
$chkStatus=$v;
|
|
break;
|
|
}
|
|
}
|
|
if($chkStatus==0)$this->error('无权限',url('admin/Index/index'));
|
|
|
|
if (!request()->isAjax()){
|
|
$this->error('提交方式不正确');
|
|
}else {
|
|
//下面相关业务代码
|
|
if(input('submitType')==1) {
|
|
$status = 31;//挂牌上市成功:31
|
|
if(empty($roadshowdt)){
|
|
$this->error('请输入挂牌上市仪式时间!');
|
|
}
|
|
}elseif(input('submitType')==2){
|
|
$status = 52;//挂牌会员修改中(挂牌上市审核未通过):52
|
|
}elseif(input('submitType')==3){
|
|
//无
|
|
}elseif(input('submitType')==4) {
|
|
$status = 53;//补交材料中(挂牌上市审核未通过):53
|
|
}
|
|
$passStatus=31;
|
|
$reuploadStatus=53;
|
|
if(config('cult4advice.checkboard')==1)
|
|
{
|
|
if(input('advice')=='')
|
|
{
|
|
$this->error('请输入挂牌上市审核意见!');
|
|
}
|
|
}
|
|
|
|
//取得基础数据
|
|
$apply=Db::name('cult4apply')->find($apply_id);
|
|
$baseinfo=Db::name('cult4baseinfo')->find(input('base_id'));
|
|
|
|
//固定文件审核通过并且所有模板文件与文件数量对应
|
|
if( count(get_unuploadfiles($apply_id,-1,12)) > 0) {
|
|
if($status==$passStatus)
|
|
$this->error('如果文件已经审核完成,请点击补交材料!如果文件未提交或未审核,请先审核或上传文件!');
|
|
if($status==$reuploadStatus){
|
|
$rst=get_unuploadfiles($apply_id,$status,12,-1,1);
|
|
//查看是否有推荐机构上传资料
|
|
$rst2=get_unuploadfiles($apply_id,$status,12,-1,4);
|
|
if(count($rst)==0) {
|
|
if(count($rst2)>0) {
|
|
if(!$baseinfo['member_recmd']){
|
|
$this->error('未关联推荐机构,请代推荐机构添加要补交的材料!');
|
|
}
|
|
}else{
|
|
$this->error('请添加要补交的材料,或者选择要重新审核的材料!');
|
|
}
|
|
}
|
|
}
|
|
}else{
|
|
if($status==$reuploadStatus)
|
|
$this->error('请添加要补交的材料,或者选择要重新审核的材料!');
|
|
}
|
|
|
|
//防止重复提交
|
|
if (!checkToken(input('TOKEN'))) {
|
|
return;
|
|
}
|
|
|
|
Db::startTrans();
|
|
|
|
try {
|
|
//更新表cult4checkboard
|
|
$sl_data['apply_id'] = $apply_id;
|
|
$sl_data['advice'] = input('advice', "未填写");
|
|
$sl_data['create_id'] = $user_id;
|
|
$sl_data['create_time'] = time();
|
|
|
|
//找到当前最大addorder
|
|
$where = array(
|
|
'apply_id' => $apply_id,
|
|
);
|
|
$check = Db::name('cult4checkboard')->where($where)->order('addorder desc')->find();
|
|
if (!empty($check)) {
|
|
$sl_data['addorder'] = $check['addorder'] + 1;
|
|
} else {
|
|
$sl_data['addorder'] = 0;
|
|
}
|
|
Db::name('cult4checkboard')->insert($sl_data);
|
|
|
|
//更新基本信息表为已审核cult4baseinfo
|
|
$sl_data2['base_id'] = input('base_id');
|
|
$sl_data2['flag'] = 1;
|
|
if ($status == $passStatus) {
|
|
$sl_data2['roadshowdt'] = $roadshowdt;
|
|
$sl_data2['roadshowdt_oper_id'] = $user_id;
|
|
$sl_data2['roadshowdt_oper_time'] = time();
|
|
}
|
|
$where2=array(
|
|
'base_id'=>input('base_id'),
|
|
);
|
|
Db::name('cult4baseinfo')->where($where2)->update($sl_data2);
|
|
//更新主表cult4apply
|
|
$sl_data3['apply_id']=$apply_id;
|
|
$sl_data3['status']=$status;
|
|
$sl_data3['update_user_id']=$user_id;
|
|
$sl_data3['update_user_type']=2;//后台
|
|
$sl_data3['update_time']=time();
|
|
$sl_data3['apply_admin_id']=0;
|
|
$where3=array(
|
|
'apply_id'=>$apply_id,
|
|
'status'=>$chkStatus,
|
|
);
|
|
Db::name('cult4apply')->where($where3)->update($sl_data3);
|
|
|
|
//更新文件表当前所有未通过的记录为历史记录,上传人需要重新上传
|
|
if($status==$reuploadStatus){
|
|
$where4=array(
|
|
'apply_id'=>$apply_id,
|
|
'new_flag'=>1,//当前最新记录
|
|
'flag'=>0,//未审核通过
|
|
);
|
|
$sl_data4['new_flag']=0;
|
|
Db::name('cult4upfiles')->where($where4)->update($sl_data4);
|
|
}
|
|
/**
|
|
* 增加通知推送,by rainfer
|
|
*/
|
|
if($baseinfo['apply_type']==1){
|
|
$baseinfo_name=$baseinfo['c_name'];
|
|
}elseif ($baseinfo['apply_type']==2){
|
|
$baseinfo_name=$baseinfo['p_name'];
|
|
}else{
|
|
$baseinfo_name=$baseinfo['t_apply_username'];
|
|
}
|
|
//审核不通过时,推送通知
|
|
if($status==52 || $status==53){
|
|
if($status==52){
|
|
//审核不通过,回到修改中,由会员前台重写修改提交
|
|
$notice_title='【'.$baseinfo_name.'】申请挂牌上市审核不通过!';
|
|
$notice='您的【'.$baseinfo_name.'】申请挂牌上市审核不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_editcheck',['apply_id'=>$apply_id]).'">修改材料</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$apply['user_id'],
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
|
|
}elseif($status==53){
|
|
//需要上传的文件
|
|
$unpassfiles=get_unuploadfiles($apply_id,$status,12);
|
|
$has_send=[];
|
|
foreach ($unpassfiles as $v){
|
|
if($v['upload_role_type']==1){
|
|
$to_uids=[];
|
|
if($v['upload_role_id']==1){
|
|
//基础会员 挂牌会员
|
|
$to_uids[]=$apply['user_id'];
|
|
}elseif ($v['upload_role_id']==3){
|
|
//专家会员
|
|
$to_uids=Db::name('cult4proassign')->where(['assign_type'=>0,'apply_id'=>$apply_id,'del_flag'=>0])->column('user_id');
|
|
}elseif ($v['upload_role_id']==4){
|
|
//推荐会员
|
|
$to_uids[]=$baseinfo['member_recmd'];
|
|
}
|
|
if($to_uids){
|
|
foreach ($to_uids as $to_uid){
|
|
//未推送过
|
|
if($to_uid && !in_array($to_uid,$has_send)){
|
|
//补交材料,回到前台补交资料
|
|
$notice_title='【'.$baseinfo_name.'】申请挂牌上市审核不通过,请补充资料!';
|
|
$notice='您(或您关联)的【'.$baseinfo_name.'】申请挂牌上市审核不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_upcheck',['apply_id'=>$apply_id]).'">补充资料</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$to_uid,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
$has_send[]=$to_uid;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if($v['upload_role_type2']==1){
|
|
$to_uids=[];
|
|
if($v['upload_role_id2']==1){
|
|
//基础会员 挂牌会员
|
|
$to_uids[]=$apply['user_id'];
|
|
}elseif ($v['upload_role_id2']==3){
|
|
//专家会员
|
|
$to_uids=Db::name('cult4proassign')->where(['assign_type'=>0,'apply_id'=>$apply_id,'del_flag'=>0])->column('user_id');
|
|
}elseif ($v['upload_role_id2']==4){
|
|
//推荐会员
|
|
$to_uids[]=$baseinfo['member_recmd'];
|
|
}
|
|
if($to_uids){
|
|
foreach ($to_uids as $to_uid){
|
|
//未推送过
|
|
if($to_uid && !in_array($to_uid,$has_send)){
|
|
//补交材料,回到前台补交资料
|
|
$notice_title='【'.$baseinfo_name.'】申请挂牌上市审核不通过,请补充资料!';
|
|
$notice='您(或您关联)的【'.$baseinfo_name.'】申请挂牌上市审核不通过,需要您重新修改信息或上传资料后再提交。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/gp_upcheck',['apply_id'=>$apply_id]).'">补充资料</a>';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$to_uid,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
$has_send[]=$to_uid;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}elseif ($status==31){//挂牌上市成功
|
|
//挂牌上市通知书
|
|
$notice_title='【'.$baseinfo_name.'】上市仪式通知书!';
|
|
$notice=' 贵方提交的深圳文化产权交易所“文化产业板” ('.$baseinfo_name.')挂牌上市申请材料已收悉,相关审核流程已完结。<BR/> 现请贵方于'.$roadshowdt.'参加深圳文化产权交易所为贵方举办的挂牌上市仪式。<BR/> 上市名称:'.$baseinfo['codename'].'<BR/> 上市代码:'.$baseinfo['code'];
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$apply['user_id'],
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
|
|
$username=get_cult4UserName($apply['user_id'],1);
|
|
//插入到前台公告
|
|
$this->_pushNotice($baseinfo['codename'],$baseinfo);
|
|
|
|
|
|
}
|
|
// 提交事务
|
|
Db::commit();
|
|
} catch (\Exception $e) {
|
|
// 回滚事务
|
|
Db::rollback();
|
|
$this->error('公告材料审核失败');
|
|
}
|
|
if($status==31){
|
|
$this->success('公告材料审核成功',url('admin/gpgl/gp_add',array('base_id'=>input('base_id'),'snd'=>rand(10000,99999))));
|
|
}else{
|
|
$this->success('公告材料审核成功',url('cult4/Cult4/apply_list12',array('base_id'=>input('base_id'),'snd'=>rand(10000,99999))));
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
* 审核号码
|
|
*/
|
|
public function apply_runcheck14(){
|
|
//本处理对应状态
|
|
$chkStatusArray = array(18);
|
|
$apply_id=input('apply_id');
|
|
$user_id=session('admin_auth.aid');
|
|
$roadshowdt=input('roadshowdt');
|
|
//权限检查
|
|
$chkStatus=0;
|
|
foreach ($chkStatusArray as $v) {
|
|
if(check_cult4UserRight($apply_id,$user_id,$v)!=0){
|
|
$chkStatus=$v;
|
|
break;
|
|
}
|
|
}
|
|
if($chkStatus==0)$this->error('无权限',url('admin/Index/index'));
|
|
|
|
if (!request()->isAjax()){
|
|
$this->error('提交方式不正确');
|
|
}else {
|
|
//下面相关业务代码
|
|
if(input('submitType')==1) {
|
|
$status = 31;//挂牌上市成功:31
|
|
if(empty($roadshowdt)){
|
|
$this->error('请输入挂牌上市仪式时间!');
|
|
}
|
|
}
|
|
$passStatus=31;
|
|
$reuploadStatus=53;
|
|
if(config('cult4advice.checkboard')==1)
|
|
{
|
|
if(input('advice')=='')
|
|
{
|
|
$this->error('请输入挂牌上市审核意见!');
|
|
}
|
|
}
|
|
|
|
//取得基础数据
|
|
$apply=Db::name('cult4apply')->find($apply_id);
|
|
|
|
|
|
|
|
//防止重复提交
|
|
if (!checkToken(input('TOKEN'))) {
|
|
return;
|
|
}
|
|
|
|
Db::startTrans();
|
|
|
|
try {
|
|
//更新基本信息表为已审核cult4baseinfo
|
|
$sl_data20['base_id']=input('base_id');
|
|
$sl_data20['apply_id']=input('apply_id');
|
|
$sl_data20['code']=input('code');
|
|
$sl_data20['code_oper_id']=$user_id;
|
|
$sl_data20['code_oper_type']=2;//后台
|
|
$sl_data20['code_oper_time']=time();
|
|
$where20=array(
|
|
'base_id'=>input('base_id'),
|
|
);
|
|
Db::name('cult4baseinfo')->where($where20)->update($sl_data20);
|
|
//更新表cult4checkboard
|
|
$sl_data['apply_id'] = $apply_id;
|
|
$sl_data['advice'] = input('advice', "未填写");
|
|
$sl_data['create_id'] = $user_id;
|
|
$sl_data['create_time'] = time();
|
|
|
|
//找到当前最大addorder
|
|
$where = array(
|
|
'apply_id' => $apply_id,
|
|
);
|
|
$check = Db::name('cult4checkboard')->where($where)->order('addorder desc')->find();
|
|
if (!empty($check)) {
|
|
$sl_data['addorder'] = $check['addorder'] + 1;
|
|
} else {
|
|
$sl_data['addorder'] = 0;
|
|
}
|
|
Db::name('cult4checkboard')->insert($sl_data);
|
|
|
|
//更新基本信息表为已审核cult4baseinfo
|
|
$sl_data2['base_id'] = input('base_id');
|
|
$sl_data2['flag'] = 1;
|
|
if ($status == $passStatus) {
|
|
$sl_data2['roadshowdt'] = $roadshowdt;
|
|
$sl_data2['roadshowdt_oper_id'] = $user_id;
|
|
$sl_data2['roadshowdt_oper_time'] = time();
|
|
}
|
|
$where2=array(
|
|
'base_id'=>input('base_id'),
|
|
);
|
|
Db::name('cult4baseinfo')->where($where2)->update($sl_data2);
|
|
if($status==52){
|
|
$status=48;
|
|
}
|
|
//更新主表cult4apply
|
|
$sl_data3['apply_id']=$apply_id;
|
|
$sl_data3['status']=$status;
|
|
$sl_data3['update_user_id']=$user_id;
|
|
$sl_data3['update_user_type']=2;//后台
|
|
$sl_data3['update_time']=time();
|
|
$sl_data3['apply_admin_id']=0;
|
|
$where3=array(
|
|
'apply_id'=>$apply_id,
|
|
'status'=>$chkStatus,
|
|
);
|
|
Db::name('cult4apply')->where($where3)->update($sl_data3);
|
|
|
|
//更新文件表当前所有未通过的记录为历史记录,上传人需要重新上传
|
|
if($status==$reuploadStatus){
|
|
$where4=array(
|
|
'apply_id'=>$apply_id,
|
|
'new_flag'=>1,//当前最新记录
|
|
'flag'=>0,//未审核通过
|
|
);
|
|
$sl_data4['new_flag']=0;
|
|
Db::name('cult4upfiles')->where($where4)->update($sl_data4);
|
|
}
|
|
$baseinfo=Db::name('cult4baseinfo')->find(input('base_id'));
|
|
/**
|
|
* 增加通知推送,by rainfer
|
|
*/
|
|
$ctitle='企业公告';
|
|
if($baseinfo['apply_type']==1){
|
|
$baseinfo_name=$baseinfo['c_name'];
|
|
}elseif ($baseinfo['apply_type']==2){
|
|
$baseinfo_name=$baseinfo['p_name'];
|
|
$ctitle='项目公告';
|
|
}else{
|
|
$baseinfo_name=$baseinfo['t_apply_username'];
|
|
$ctitle='人才公告';
|
|
}
|
|
$username1=get_cult4UserName($apply['user_id'],1);
|
|
//挂牌上市通知书
|
|
//插入到前台公告
|
|
$contents1=Options::get_options('notice_options',$this->lang);
|
|
$contents_title1='深圳文交所“文化产业板”挂牌'.$ctitle.'('.$baseinfo_name.')';
|
|
$contents1['content_tpl']=isset($contents1['content_tpl'])?$contents1['content_tpl']:'';
|
|
$notice1=$contents1['content_tpl'];
|
|
$notice1=str_replace('#COMNAME#',$baseinfo_name,$notice1);
|
|
$notice1=str_replace('#CODENAME#',$baseinfo['codename'],$notice1);
|
|
$notice1=str_replace('#APPLYNAME#',$baseinfo_name,$notice1);
|
|
$notice1=str_replace('#CODE#',$baseinfo['code'],$notice1);
|
|
$notice1=str_replace('#DATE#',date('Y年m月d日', time()),$notice1);
|
|
$sl_data=[
|
|
'notice_title'=>$contents_title1,
|
|
'notice'=>$notice1,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$apply['user_id'],
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
|
|
//插入到前台公告
|
|
$this->_pushNotice($username1,$baseinfo);
|
|
//查询当前挂牌信息
|
|
// 提交事务
|
|
Db::commit();
|
|
} catch (\Exception $e) {
|
|
// 回滚事务
|
|
Db::rollback();
|
|
$this->error('公告材料审核失败');
|
|
}
|
|
if($status==31){
|
|
$this->success('公告材料审核成功',url('admin/gpgl/gp_add',array('base_id'=>input('base_id'),'snd'=>rand(10000,99999))));
|
|
}else{
|
|
$this->success('公告材料审核成功',url('cult4/Cult4/apply_list13',array('base_id'=>input('base_id'),'snd'=>rand(10000,99999))));
|
|
}
|
|
|
|
}
|
|
}
|
|
/*
|
|
* 财务人员确认业务号码
|
|
*/
|
|
public function apply_runcheck13(){
|
|
//本处理对应状态
|
|
$chkStatusArray = array(48);
|
|
$apply_id=input('apply_id');
|
|
$user_id=session('admin_auth.aid');
|
|
$roadshowdt=input('roadshowdt');
|
|
//权限检查
|
|
$chkStatus=0;
|
|
foreach ($chkStatusArray as $v) {
|
|
if(check_cult4UserRight($apply_id,$user_id,$v)!=0){
|
|
$chkStatus=$v;
|
|
break;
|
|
}
|
|
}
|
|
if($chkStatus==0)$this->error('无权限',url('admin/Index/index'));
|
|
|
|
if (!request()->isAjax()){
|
|
$this->error('提交方式不正确');
|
|
}else {
|
|
//下面相关业务代码
|
|
if(input('submitType')==1) {
|
|
$status = 18;//通过:31
|
|
}elseif(input('submitType')==2){
|
|
$status = 14;//继续上传缴费证明
|
|
}
|
|
$passStatus=31;
|
|
$reuploadStatus=53;
|
|
if(config('cult4advice.checkboard')==1)
|
|
{
|
|
if(input('advice')=='')
|
|
{
|
|
$this->error('请输入审核意见!');
|
|
}
|
|
}
|
|
|
|
//取得基础数据
|
|
$apply=Db::name('cult4apply')->find($apply_id);
|
|
$baseinfo=Db::name('cult4baseinfo')->find(input('base_id'));
|
|
|
|
|
|
//防止重复提交
|
|
if (!checkToken(input('TOKEN'))) {
|
|
return;
|
|
}
|
|
$advi=input('advice');
|
|
|
|
Db::startTrans();
|
|
|
|
try {
|
|
//更新基本信息表为已审核cult4baseinfo
|
|
$sl_data20['base_id']=input('base_id');
|
|
$sl_data20['apply_id']=input('apply_id');
|
|
$sl_data20['code']=input('code');
|
|
$sl_data20['code_oper_id']=$user_id;
|
|
$sl_data20['code_oper_type']=2;//后台
|
|
$sl_data20['code_oper_time']=time();
|
|
$where20=array(
|
|
'base_id'=>input('base_id'),
|
|
);
|
|
Db::name('cult4baseinfo')->where($where20)->update($sl_data20);
|
|
//更新表cult4checkboard
|
|
$sl_data['apply_id'] = $apply_id;
|
|
$sl_data['advice'] = input('advice', "未填写");
|
|
$sl_data['create_id'] = $user_id;
|
|
$sl_data['create_time'] = time();
|
|
|
|
//找到当前最大addorder
|
|
$where = array(
|
|
'apply_id' => $apply_id,
|
|
);
|
|
$check = Db::name('cult4checkboard')->where($where)->order('addorder desc')->find();
|
|
if (!empty($check)) {
|
|
$sl_data['addorder'] = $check['addorder'] + 1;
|
|
} else {
|
|
$sl_data['addorder'] = 0;
|
|
}
|
|
Db::name('cult4checkboard')->insert($sl_data);
|
|
|
|
//更新基本信息表为已审核cult4baseinfo
|
|
$sl_data2['base_id'] = input('base_id');
|
|
$sl_data2['flag'] = 1;
|
|
if ($status == $passStatus) {
|
|
$sl_data2['roadshowdt'] = $roadshowdt;
|
|
$sl_data2['roadshowdt_oper_id'] = $user_id;
|
|
$sl_data2['roadshowdt_oper_time'] = time();
|
|
}
|
|
$where2=array(
|
|
'base_id'=>input('base_id'),
|
|
);
|
|
Db::name('cult4baseinfo')->where($where2)->update($sl_data2);
|
|
|
|
//更新主表cult4apply
|
|
$sl_data3['apply_id']=$apply_id;
|
|
$sl_data3['status']=$status;
|
|
$sl_data3['update_user_id']=$user_id;
|
|
$sl_data3['update_user_type']=2;//后台
|
|
$sl_data3['update_time']=time();
|
|
$sl_data3['apply_admin_id']=0;
|
|
$where3=array(
|
|
'apply_id'=>$apply_id,
|
|
'status'=>$chkStatus,
|
|
);
|
|
Db::name('cult4apply')->where($where3)->update($sl_data3);
|
|
if($status==14){
|
|
$baseinfot=Db::name('cult4baseinfo')->find(input('base_id'));
|
|
/**
|
|
* 增加通知推送,by rainfer
|
|
*/
|
|
if($baseinfot['apply_type']==1){
|
|
$baseinfo_namet=$baseinfot['c_name'];
|
|
}elseif ($baseinfot['apply_type']==2){
|
|
$baseinfo_namet=$baseinfot['p_name'];
|
|
}else{
|
|
$baseinfo_namet=$baseinfot['t_apply_username'];
|
|
}
|
|
//审核不通过,回到修改中,由会员前台重写修改提交
|
|
$notice_title='【'.$baseinfo_namet.'】缴费证明审核不通过!';
|
|
$notice='您的【'.$baseinfo_namet.'】缴费证明审核不通过,请重新上传缴费证明!。</br>请点击: <a class="editcheck btn btn-danger" href="'.url('home/Center/my',['apply_id'=>$apply_id]).'">上传缴费证明</a></br> 反驳意见:'.$advi.'';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$apply['user_id'],
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('cult4notice')->insert($sl_data);
|
|
}
|
|
|
|
// 提交事务
|
|
Db::commit();
|
|
} catch (\Exception $e) {
|
|
// 回滚事务
|
|
Db::rollback();
|
|
$this->error('公告材料审核失败');
|
|
}
|
|
if($status==18){
|
|
$this->success('公告材料审核成功',url('cult4/Cult4/apply_list13',array('base_id'=>input('base_id'),'snd'=>rand(10000,99999))));
|
|
}else{
|
|
$this->success('公告材料审核成功',url('cult4/Cult4/apply_list13',array('base_id'=>input('base_id'),'snd'=>rand(10000,99999))));
|
|
}
|
|
|
|
}
|
|
}
|
|
|
|
//已挂牌列表返回
|
|
public function apply_runcheck_final()
|
|
{
|
|
$this->success('返回成功',url('cult4/Cult4/apply_list_final'));
|
|
}
|
|
|
|
//特殊号段
|
|
public function number_list()
|
|
{
|
|
$search_name=input('search_name');
|
|
$this->assign('search_name',$search_name);
|
|
$map=array();
|
|
if($search_name){
|
|
$map['saleno']= array('like',"%".$search_name."%");
|
|
}
|
|
$number_list=Db::name('cult4number')->where($map)->order('salestatus,status desc,id')->paginate(config('paginate.list_rows'),false,['query'=>get_query()]);
|
|
$page = $number_list->render();
|
|
$this->assign('number_list',$number_list);
|
|
$this->assign('page',$page);
|
|
return $this->fetch();
|
|
}
|
|
/**
|
|
* 特殊号段开启/禁止
|
|
*/
|
|
public function number_state()
|
|
{
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
$this->error('用户ID不存在',url('cult4/Cult4/number_list'));
|
|
}
|
|
$status=Db::name('cult4number')->where('id',$id)->value('status');//判断当前状态情况
|
|
if($status==1){
|
|
$statedata = array('status'=>0);
|
|
Db::name('cult4number')->where('id',$id)->setField($statedata);
|
|
$this->success('状态禁止');
|
|
}else{
|
|
$statedata = array('status'=>1);
|
|
Db::name('cult4number')->where('id',$id)->setField($statedata);
|
|
$this->success('状态开启');
|
|
}
|
|
}
|
|
public function number_state2()
|
|
{
|
|
$id=input('x');
|
|
if (empty($id)){
|
|
$this->error('用户ID不存在',url('cult4/Cult4/number_list'));
|
|
}
|
|
$status=Db::name('cult4number')->where('id',$id)->value('salestatus');//判断当前状态情况
|
|
if($status==1){
|
|
$statedata = array('salestatus'=>0);
|
|
Db::name('cult4number')->where('id',$id)->setField($statedata);
|
|
$this->success('当前为未销售状态');
|
|
}else{
|
|
$statedata = array('salestatus'=>1);
|
|
Db::name('cult4number')->where('id',$id)->setField($statedata);
|
|
$this->success('当前为已销售状态');
|
|
}
|
|
}
|
|
/**
|
|
* 特殊号段添加
|
|
*/
|
|
public function number_add()
|
|
{
|
|
//创建token
|
|
creatToken();
|
|
return $this->fetch();
|
|
}
|
|
/**
|
|
* 特殊号段添加操作
|
|
*/
|
|
public function number_runadd()
|
|
{
|
|
//防止重复提交
|
|
if (!checkToken(input('TOKEN'))) {
|
|
return;
|
|
}
|
|
$id=Cult4number::add(input('saleno',''),input('price',0),input('status',0),input('salestatus',0),session('admin_auth.aid'),time());
|
|
if($id){
|
|
$this->success('特殊号码添加成功',url('cult4/Cult4/number_list'));
|
|
}else{
|
|
$this->error('特殊号码添加失败',url('cult4/Cult4/number_list'));
|
|
}
|
|
}
|
|
/**
|
|
* 特殊号段修改
|
|
*/
|
|
public function number_edit()
|
|
{
|
|
//创建token
|
|
creatToken();
|
|
$id=input('id',0);
|
|
if($id<=0){
|
|
$this->error('特殊号码编辑失败',url('cult4/Cult4/number_list'));
|
|
}
|
|
$number_list=Db::name('cult4number')->find($id);
|
|
$this->assign('number_list',$number_list);
|
|
|
|
return $this->fetch();
|
|
}
|
|
/**
|
|
* 特殊号段修改操作
|
|
*/
|
|
public function number_runedit()
|
|
{
|
|
//防止重复提交
|
|
if (!checkToken(input('TOKEN'))) {
|
|
return;
|
|
}
|
|
$id=Cult4number::edit(input('id',0),input('saleno',''),input('price',0),input('status',0),input('salestatus',0),session('admin_auth.aid'),time());;
|
|
if($id){
|
|
$this->success('特殊号码修改成功',url('cult4/Cult4/number_list'));
|
|
}else{
|
|
$this->error('特殊号码修改失败',url('cult4/Cult4/number_list'));
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
|