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.
2245 lines
122 KiB
2245 lines
122 KiB
<?php
|
|
namespace app\capital\controller;
|
|
use app\admin\controller\Base;
|
|
use app\admin\model\Options;
|
|
use app\capital\model\Capitalapply as ApplyModel;
|
|
use app\capital\model\Capitaluptype as UptypeModel;
|
|
use app\capital\model\Capitalapply;
|
|
use app\capital\model\Capitalcheck;
|
|
use app\capital\model\Capitalfee;
|
|
use think\Db;
|
|
use think\Controller;
|
|
use app\api\controller\FddTool;
|
|
use app\capital\model\Capitaldetail;
|
|
|
|
class Capital extends Base{
|
|
protected $process=[
|
|
1=>[10,20,30,50,60,70,80,90],
|
|
[10,30,40,100,50,60,110],
|
|
[10,20,60,70,90],
|
|
[10,20,60,70,90]
|
|
];
|
|
//$status = 10;流程
|
|
//$apply_status = 0;//默认显示待审核
|
|
public function apply_list($status,$apply_status){
|
|
$bAll=input('search_all');
|
|
$apply_type=input('apply_type');
|
|
$this->assign('apply_type',$apply_type);
|
|
$this->assign('search_all',$bAll);
|
|
|
|
$search_name=input('search_name');
|
|
$this->assign('search_name',$search_name);
|
|
if($bAll == -1){
|
|
$apply_list=ApplyModel::getList($search_name,$status,'create_time desc,apply_id desc',-1,$apply_type);
|
|
}else{
|
|
$apply_list=ApplyModel::getList($search_name,$status,'create_time desc,apply_id desc',$apply_status,$apply_type);
|
|
}
|
|
$page = $apply_list->render();
|
|
$this->assign('apply_types',config('apply_type'));
|
|
if($apply_list){
|
|
$apply_list=$apply_list->toArray();
|
|
$apply_list=$apply_list['data'];
|
|
if(count($apply_list)){
|
|
$uids=array_search_key('user_id',$apply_list);
|
|
$uids=array_flip(array_flip($uids));
|
|
$usernams = $this->get_UserNames(implode(',', $uids),1);
|
|
$statuses=$this->get_UserStatuses(implode(',', $uids), 1);
|
|
foreach ($apply_list as $key=>$row){
|
|
$userid=$row['user_id'];
|
|
$apply_list[$key]['username']=isset($usernams[$userid])?$usernams[$userid]:'';
|
|
$apply_list[$key]['userstatus']=isset($statuses[$userid])?$statuses[$userid]:'';
|
|
$apply_id = $row['apply_id'];
|
|
$where['apply_id'] = $apply_id;
|
|
$apply_list[$key]['feeinfo'] = Db::name('capitalfee')->where($where)->find();
|
|
}
|
|
}
|
|
}
|
|
$this->assign('apply_list',$apply_list);
|
|
$this->assign('page',$page);
|
|
$this->assign('status',config("status".$apply_type));
|
|
|
|
$this->assign('loginuser',session('admin_auth.aid'));
|
|
$this->assign('loginrole',session('admin_auth.role'));
|
|
|
|
return $this->fetch();
|
|
}
|
|
public function apply_list10(){
|
|
//材料初审 10
|
|
return $this->apply_list(10,0);
|
|
}
|
|
public function apply_list20(){
|
|
//材料复审 20
|
|
return $this->apply_list(20,0);
|
|
}
|
|
public function apply_list50(){
|
|
//缴费 30
|
|
return $this->apply_list(50,0);
|
|
}
|
|
public function apply_list60(){
|
|
//缴费确认40
|
|
return $this->apply_list(60,0);
|
|
}
|
|
public function apply_list70(){
|
|
//联席会审核50
|
|
return $this->apply_list(70,0);
|
|
}
|
|
public function apply_list80(){
|
|
//材料核实60
|
|
return $this->apply_list(80,0);
|
|
}
|
|
public function apply_list90(){
|
|
//公告材料核实
|
|
return $this->apply_list(90,-1);
|
|
}
|
|
public function apply_list30(){
|
|
//专家分配
|
|
return $this->apply_list(30,0);
|
|
}
|
|
public function apply_list40(){
|
|
//专家审核确认
|
|
return $this->apply_list(40,0);
|
|
}
|
|
public function apply_list100(){
|
|
//材料复审 20
|
|
return $this->apply_list(100,0);
|
|
}
|
|
|
|
public function apply_list110(){
|
|
//材料复审 20
|
|
return $this->apply_list(110,-1);
|
|
}
|
|
/**
|
|
* 03.专家分配添加
|
|
* 04.专家分配添加
|
|
* @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');
|
|
$apply_type=input('apply_type');
|
|
$this->assign('apply_type',$apply_type);
|
|
//检查是否超出限额
|
|
$whereCnt['apply_id']=array('eq', $apply_id);
|
|
$whereCnt['del_flag']=array('eq', 0);
|
|
$assignCnt = Db()->name('capitalproassign')->where($whereCnt)->count();
|
|
if($assignCnt>=config('capitalProLimit')){
|
|
$this->error('专家分配已超出限额!最多分配'.config('capitalProLimit').'名专家',url('capital/Capital/apply_assign',array('apply_id'=>$apply_id,'apply_type'=>$apply_type,'p'=>$p)));
|
|
}
|
|
$check=Db()->name('capitalproassign')->where(['apply_id'=>$apply_id,'user_id'=>$member_list_id,'del_flag'=>0])->count();
|
|
if($check){
|
|
$this->error('此专家已经分配',url('capital/Capital/apply_assign',array('apply_id'=>$apply_id,'apply_type'=>$apply_type,'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('capitalProScore'),
|
|
'create_id'=>$user_id,
|
|
'create_time'=>time(),
|
|
);
|
|
$rst=Db::name('capitalproassign')->insert($sl_data);
|
|
$msg=($rst!==false)?'专家分配成功':'专家分配失败';
|
|
$jump='';
|
|
if($assign_type==0)
|
|
$jump=url('capital/Capital/apply_check30',array('apply_id'=>$apply_id,'p'=>$p,'apply_type'=>$apply_type));//专家分配
|
|
elseif($assign_type==1)
|
|
$jump=url('capital/Capital/apply_check40',array('apply_id'=>$apply_id,'apply_type'=>$apply_type,'snd'=>rand(10000,99999)));//专家审核确认
|
|
|
|
if($rst!==false){
|
|
$this->success($msg,$jump);
|
|
}else{
|
|
$this->error($msg,$jump);
|
|
}
|
|
|
|
}
|
|
/**
|
|
* 03.专家分配删除
|
|
* 04.专家分配删除
|
|
*/
|
|
public function apply_assign_del($assign_type=0){
|
|
$p=input('p');
|
|
$pro_id=input('id');
|
|
$apply_id=input('apply_id');
|
|
$apply_type=input('apply_type');
|
|
$this->assign('apply_type',$apply_type);
|
|
$where=array('pro_id'=>$pro_id);
|
|
$sl_data=array('del_flag'=>1);
|
|
$rst=Db::name('capitalproassign')->where($where)->update($sl_data);
|
|
|
|
$msg=($rst!==false)?'已分配专家删除成功':'已分配专家删除失败';
|
|
$jump='';
|
|
if($assign_type==0)
|
|
$jump=url('capital/Capital/apply_check30',array('apply_id'=>$apply_id,'apply_type'=>$apply_type,'p'=>$p));//专家分配
|
|
elseif($assign_type==1)
|
|
$jump=url('capital/Capital/apply_check40',array('apply_id'=>$apply_id,'apply_type'=>$apply_type,'snd'=>rand(10000,99999)));//专家审核确认
|
|
|
|
if($rst!==false){
|
|
$this->success($msg,$jump);
|
|
}else{
|
|
$this->error($msg,$jump);
|
|
}
|
|
}
|
|
public function apply_assign_finish(){
|
|
//本处理对应状态
|
|
$chkStatus = 30;
|
|
$apply_id=input('apply_id');
|
|
$user_id=session('admin_auth.aid');
|
|
$submitType=input('submitType');
|
|
$apply_type=input('apply_type');
|
|
$this->assign('apply_type',$apply_type);
|
|
//下面相关业务代码
|
|
if($submitType==1) {
|
|
$this->success('返回成功!',url('capital/Capital/apply_list30',array('apply_type'=>$apply_type)));
|
|
}elseif($submitType==2 or $submitType==3) {//分配完成
|
|
//统一推送消息
|
|
$user_ids=Db::name('capitalproassign')->where(['apply_id'=>$apply_id,'del_flag'=>0])->order('pro_id desc')->column('user_id');
|
|
if($user_ids){
|
|
/**
|
|
* 增加通知推送,by rainfer
|
|
*/
|
|
$baseinfo=Db::name('capitalbaseinfo')->where(['apply_id'=>$apply_id])->find();
|
|
$applytype=$baseinfo['apply_type'];
|
|
$baseinfo_name=$baseinfo['hoster_name'];
|
|
|
|
foreach($user_ids as $v){
|
|
$notice_title='【'.$baseinfo_name.'】托管申请的专家评审分配给您!';
|
|
$notice='【'.$baseinfo_name.'】托管申请的专家评审分配给您,请您评审,请点击: <a class="editcheck btn btn-danger" href="'.url('home/Listn/tg_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('capitalnotice')->insert($sl_data);
|
|
}
|
|
}else{
|
|
$this->error('请先至少分配1名专家!');
|
|
}
|
|
|
|
//专家评分中(专家已分配):15
|
|
//更新主表cult4apply
|
|
$sl_data3['apply_id']=$apply_id;
|
|
$sl_data3['status']=40;
|
|
$sl_data3['update_time']=time();
|
|
$where3=array(
|
|
'apply_id'=>$apply_id,
|
|
'status'=>$chkStatus,
|
|
);
|
|
Db::name('capitalapply')->where($where3)->update($sl_data3);
|
|
if($submitType==2){
|
|
$jump=url('capital/Capital/apply_list40',array('apply_type'=>$apply_type));
|
|
}elseif($submitType==3){
|
|
$jump=url('capital/Capital/apply_list50',array('apply_id'=>$apply_id,'apply_type'=>$apply_type,'snd'=>rand(10000,99999)));
|
|
}
|
|
$this->addnotice($apply_id);
|
|
$this->success('专家分配成功!',$jump);
|
|
}
|
|
}
|
|
|
|
/*
|
|
* 审核用户信息界面
|
|
*/
|
|
public function apply_check($process){
|
|
$upload=input('upload','');
|
|
$apply_id=input('apply_id');
|
|
$user_id=session('admin_auth.aid');
|
|
$this->assign('user_id',$user_id);
|
|
$apply_type=input('apply_type');
|
|
$this->assign('apply_type',$apply_type);
|
|
$where=array('apply_id'=>$apply_id);
|
|
$baseinfo = Db::name('capitalbaseinfo')->where($where)->find();
|
|
$applyinfo = Db::name('capitalapply')->where($where)->find();
|
|
$code='';
|
|
if($upload=='contract'){
|
|
$contract_status=$baseinfo['contract_status']?$baseinfo['contract_status']:1;
|
|
if($contract_status==2)$contract_status=3;
|
|
$key=$upload;
|
|
if(!$key)return $this->error('參數錯誤');
|
|
$file = request()->file($key);
|
|
// 移动到框架应用根目录/uploads/ 目录下
|
|
$uploadpath=config('upload_path');
|
|
$path=ROOT_PATH . config('upload_path');
|
|
$validate = config('upload_validate');
|
|
$info = $file->validate($validate)->move($path);
|
|
$status=$applyinfo['status'];
|
|
|
|
if($info){
|
|
$data=array();
|
|
$data['ext']=$info->getExtension();
|
|
$path=$uploadpath.DS.$info->getSaveName();;
|
|
$data['path']=$path;
|
|
$data['filename']=$info->getFilename();
|
|
$udata=['contract'=>$path,'contract_status'=>$contract_status];
|
|
|
|
if($contract_status==3){
|
|
$process=$this->process[$apply_type];
|
|
$index=array_search($status,$process);
|
|
|
|
$index=$index+1;
|
|
$next_status=$process[$index];
|
|
Db::name('capitalapply')->where(['apply_id'=>$apply_id])->update(['status'=>$next_status]);
|
|
|
|
}
|
|
Db::name('capitalbaseinfo')->where($where)->update(['contract'=>$path,'contract_status'=>$contract_status]);
|
|
|
|
return $this->success('上傳成功',url('apply_list'.$status,['apply_type'=>$apply_type]),$data);
|
|
}else{
|
|
return $this->error($file->getError());
|
|
}
|
|
}
|
|
//专家分配
|
|
$member_list = Db::query("SELECT a.*,count(*) as CNT FROM `".config('database.prefix')."member_list` as a left join `".config('database.prefix')."capitalproassign` as b on a.member_list_id=b.user_id and (b.del_flag=0) WHERE a.member_list_groupid=6 and a.member_list_id not in(select user_id from ".config('database.prefix')."capitalproassign where del_flag=0 and apply_id=".$apply_id.") GROUP BY member_list_id order by CNT;");
|
|
$this->assign('member_list',$member_list);
|
|
|
|
|
|
$user_list = Db::query("SELECT member_list_username,member_list_id,member_list_nickname,member_list_tel FROM `".config('database.prefix')."member_list` order by member_list_id desc");
|
|
|
|
$this->assign('user_list',$user_list);
|
|
|
|
//已分配专家及分配专家评分
|
|
$pro_list_assigned = Db::query("SELECT b.*,a.* FROM `".config('database.prefix')."capitalproassign` 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('member_list_assigned',$pro_list_assigned);
|
|
|
|
//取得当前审核表
|
|
$this->assign('applyinfo',$applyinfo);
|
|
$this->assign('apply_id',$apply_id);
|
|
//取得基本信息表
|
|
if(empty($baseinfo)){
|
|
$this->error('未录入会员基础信息表!',url('capital/Capital/apply_list'.$process,array('apply_type'=>$apply_type)));
|
|
}
|
|
if($apply_type==2){
|
|
$baseinfo['capital_type']=explode(',',$baseinfo['capital_type']);
|
|
$baseinfo['tg_type']=explode(',',$baseinfo['tg_type']);
|
|
$baseinfo['hoster_reason']=explode(',',$baseinfo['hoster_reason']);
|
|
}
|
|
$this->assign('baseinfo',$baseinfo);
|
|
if($process==40&&$apply_type==2){
|
|
//取得所有历史审核记录
|
|
$where=array('apply_id'=>$apply_id,'del_flag'=>1);
|
|
$procheck = Db::name('capitalproassign')->where($where)->order('pro_id desc') ->select();
|
|
|
|
$this->assign('procheck',$procheck);
|
|
$apply_type=$baseinfo['apply_type'];
|
|
//取得apply_id对应的专家评分中(专家已分配)状态下的所有固定文件类型最新记录
|
|
$apply_uptypelist_checkpro=UptypeModel::getList($apply_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,$apply_id,2,array(14,15,23),1,'ftype_id,status,apply_id,isopen',-1);
|
|
$this->assign('apply_uptypelist_tempcheckpro',$apply_uptypelist_tempcheckpro);
|
|
}
|
|
$where=array('apply_id'=>$apply_id);
|
|
//取得基本信息表
|
|
$upfilelist = Db::name('capital_upfiles')->where($where)->where(['new_flag'=>1])->select();
|
|
|
|
if(!empty($upfilelist)){
|
|
if(count($upfilelist)){
|
|
$uids=array_search_key('user_id',$upfilelist);
|
|
$uids=array_flip(array_flip($uids));
|
|
$usernams = $this->get_UserNames(implode(',', $uids),1);
|
|
foreach ($upfilelist as $key=>$row){
|
|
$wh = array('ftype_id'=>$row['ftype_id']);
|
|
$uptype = Db::name('capitaluptype')->where($wh)->find();
|
|
|
|
$userid=$row['user_id'];
|
|
$upfilelist[$key]['username']=isset($usernams[$userid])?$usernams[$userid]:'';
|
|
$upfilelist[$key]['ftypedescr']= $uptype['ftypedescr'];
|
|
|
|
|
|
}
|
|
}
|
|
|
|
}
|
|
$this->assign('upfilelist',$upfilelist);
|
|
$products = Db::name('capitaldetail')->where($where)->select();
|
|
|
|
if(!empty($products)){
|
|
if(count($products)){
|
|
$xcopt=Db::name('options')->where(array('option_name'=>'xcnum_options'))->find();
|
|
|
|
if(is_string($xcopt['option_value']))$xcopt=json_decode($xcopt['option_value'],true);
|
|
$xcnum=isset($xcopt['num'])?intval($xcopt['num']):1;
|
|
|
|
foreach ($products as $key=>$row){
|
|
if($apply_type==3&&$row['capital_type']){
|
|
$captype=$row['capital_type'];
|
|
$capchild=$row['capital_child'];
|
|
$year=$row['capital_year']?$row['capital_year']:'';
|
|
$land=$row['capital_land']?$row['capital_land']:'';
|
|
$info=($row['capital_info'])?$row['capital_info']:'';
|
|
$cclass=($row['capital_class'])?$row['capital_class']:'';
|
|
$rank=$row['capital_rank']?$row['capital_rank']:'';
|
|
if($info)$info=explode(',',$info);
|
|
|
|
$capele=$row['capital_elem'];
|
|
if($capele)$capele=explode(',',$capele);
|
|
$classs=[1=>'徽派','晋派','京派','苏派','闽派 ','川派','岭南派','赣派','其他'];
|
|
$elems=['1'=>'资产所有权','资产使用权','资产收益权','资产租赁权'];
|
|
$years=['1'=>'明朝','清朝','民国','其它'];
|
|
$ranks=['1'=>'国家级','省级','市级','市级'];
|
|
$infos=['1'=>'有人居住','文旅开发','存在第三方机构','其它'];
|
|
$lands=['1'=>'商业用地','综合用地','住宅用地','工业用地','其它'];
|
|
|
|
$childs=config("building.childs");
|
|
|
|
if(isset($childs[$captype][$capchild]))$capchild=$childs[$captype][$capchild];
|
|
if(is_array($capele)){
|
|
$elestr='';
|
|
foreach ($capele as $erow){
|
|
if(isset($elems[$erow]))$elestr.=$elems[$erow].';';
|
|
}
|
|
$capele=rtrim($elestr,';');
|
|
}
|
|
if(is_array($info)){
|
|
$elestr='';
|
|
foreach ($info as $erow){
|
|
if(isset($infos[$erow]))$elestr.=$infos[$erow].';';
|
|
}
|
|
$info=rtrim($elestr,';');
|
|
}
|
|
if(isset($years[$year]))$year=$years[$year];
|
|
if(isset($lands[$land]))$land=$lands[$land];
|
|
if(isset($classs[$cclass]))$cclass=$classs[$cclass];
|
|
if(isset($ranks[$rank]))$rank=$ranks[$rank];
|
|
|
|
if($captype==5)$captype='构件类';
|
|
if($captype==15)$captype='在建类';
|
|
if($captype==35)$captype='仿古类';
|
|
if($captype==45)$captype='产权类';
|
|
if($captype==55)$captype='现存独立古建';
|
|
$products[$key]['capital_type']=$captype;
|
|
|
|
$products[$key]['capital_child']=$capchild;
|
|
$products[$key]['capital_elem']=$capele;
|
|
$products[$key]['capital_class']=$cclass;
|
|
$products[$key]['capital_rank']=$rank;
|
|
$products[$key]['capital_year']=$year;
|
|
$products[$key]['capital_land']=$land;
|
|
$products[$key]['capital_info']=$info;
|
|
$products[$key]['capital_floor']=$row['capital_floor']>0?$row['capital_floor']:'';
|
|
|
|
}
|
|
if($apply_type==4){
|
|
$captype=$row['capital_type'];
|
|
$pkind=$row['capital_kind'];
|
|
$capchild=$row['capital_child'];
|
|
$year=$row['capital_year']?$row['capital_year']:'';
|
|
|
|
if($process==10){
|
|
$code='XCZX';
|
|
$code.=$capchild.sprintf("%04s",$xcnum);
|
|
$products[$key]['code']=$code;
|
|
$xcnum++;
|
|
}
|
|
$capele=$row['capital_elem'];
|
|
if($capele)$capele=explode(',',$capele);
|
|
$classs=[1=>'徽派','晋派','京派','苏派','闽派 ','川派','岭南派','赣派','其他'];
|
|
$elems=['1'=>'资产所有权','资产使用权','资产收益权','资产租赁权'];
|
|
$years=['1'=>'明朝','清朝','民国','其它'];
|
|
$kinds=['1'=>'金溪专区','德化专区','无'];
|
|
|
|
$childs=config("building.childs2");
|
|
|
|
if(isset($childs[$captype][$capchild]))$capchild=$childs[$captype][$capchild];
|
|
if(is_array($capele)){
|
|
$elestr='';
|
|
foreach ($capele as $erow){
|
|
if(isset($elems[$erow]))$elestr.=$elems[$erow].';';
|
|
}
|
|
$capele=rtrim($elestr,';');
|
|
}
|
|
if(isset($years[$year]))$year=$years[$year];
|
|
|
|
if($captype==5)$captype='构件类';
|
|
if($captype==15)$captype='在建类';
|
|
if($captype==35)$captype='仿古类';
|
|
if($captype==45)$captype='产权类';
|
|
$products[$key]['capital_type']=$captype;
|
|
|
|
$products[$key]['capital_child']=$capchild;
|
|
$products[$key]['capital_elem']=$capele;
|
|
$products[$key]['capital_year']=$year;
|
|
$products[$key]['capital_kind']=isset($kinds[$pkind])?$kinds[$pkind]:'';
|
|
|
|
}
|
|
if($row['hoster_reason']){
|
|
$reason=explode(",", $row['hoster_reason']);
|
|
$str='';
|
|
if(in_array(1,$reason))$str.='资产背书';
|
|
if(in_array(2,$reason))$str.='、协议转让';
|
|
if(in_array(3,$reason))$str.='、资产拍卖';
|
|
if(in_array(4,$reason))$str.='、资产管理计划(产品设计)';
|
|
$products[$key]['hoster_reason']=$str;
|
|
}
|
|
$products[$key]['capital_files']=explode(";", $row['capital_files']);
|
|
}
|
|
Options::set_options(array('num'=>$xcnum),'xcnum_options');
|
|
}
|
|
}
|
|
$this->assign('products',$products);
|
|
|
|
|
|
$checkinfo = Db::name('capitalcheck')->where($where)->select();
|
|
|
|
$this->assign('checkinfo',json_encode($checkinfo));
|
|
$apply_type=$baseinfo['apply_type'];
|
|
$this->assign('apply_type',$apply_type);
|
|
$this->assign('apply_types',config('apply_type'));
|
|
$this->assign('status',json_encode(config("status".$apply_type)));
|
|
$this->assign('statuslist',config("status".$apply_type));
|
|
$this->assign('upfiles',config('upfiles'));
|
|
$this->assign('process',$process);
|
|
$this->assign('code',$code);
|
|
$tpl='';
|
|
if($process=='30'&&$apply_type==2){
|
|
$tpl="apply_assign";
|
|
}
|
|
return $this->fetch($tpl);
|
|
}
|
|
public function apply_check10(){
|
|
return $this->apply_check(10);
|
|
}
|
|
public function apply_check20(){
|
|
return $this->apply_check(20);
|
|
}
|
|
public function apply_check50(){
|
|
return $this->apply_check(50);
|
|
}
|
|
public function apply_check60(){
|
|
return $this->apply_check(60);
|
|
}
|
|
public function apply_check70(){
|
|
return $this->apply_check(70);
|
|
}
|
|
public function apply_check80(){
|
|
return $this->apply_check(80);
|
|
}
|
|
public function apply_check90(){
|
|
return $this->apply_check(90);
|
|
}
|
|
public function apply_check100(){
|
|
return $this->apply_check(100);
|
|
}
|
|
public function apply_check110(){
|
|
return $this->apply_check(110);
|
|
}
|
|
public function apply_check30(){
|
|
return $this->apply_check(30);
|
|
}
|
|
|
|
public function apply_check40(){
|
|
return $this->apply_check(40);
|
|
}
|
|
public function apply_detail10(){
|
|
$status = input('status');
|
|
return $this->apply_check($status);
|
|
}
|
|
public function apply_detail20(){
|
|
$status = input('status');
|
|
return $this->apply_check($status);
|
|
}
|
|
public function apply_detail50(){
|
|
$status = input('status');
|
|
return $this->apply_check($status);
|
|
}
|
|
public function apply_detail60(){
|
|
$status = input('status');
|
|
return $this->apply_check($status);
|
|
}
|
|
public function apply_detail70(){
|
|
$status = input('status');
|
|
return $this->apply_check($status);
|
|
}
|
|
public function apply_detail80(){
|
|
$status = input('status');
|
|
return $this->apply_check($status);
|
|
}
|
|
public function apply_detail90(){
|
|
$status = input('status');
|
|
return $this->apply_check($status);
|
|
}
|
|
public function apply_detail30(){
|
|
$status = input('status');
|
|
return $this->apply_check($status);
|
|
}
|
|
public function apply_detail40(){
|
|
$status = input('status');
|
|
return $this->apply_check($status);
|
|
}
|
|
public function capital_status(){
|
|
|
|
$apply_id=input('apply_id');
|
|
$apply_status=input('apply_status');
|
|
$apply_type=input('apply_type');
|
|
|
|
$where=array('apply_id'=>$apply_id);
|
|
$applyinfo = Db::name('capitalapply')->where($where)->find();
|
|
|
|
|
|
$res = array('status'=>true,'msg'=>'状态修改成功','url' => "/capital/Capital/apply_list110?apply_type=".$apply_type);
|
|
$query=Db::name('capitalapply')->where($where)->update(['apply_status'=>$apply_status]);
|
|
if(!$query){
|
|
$res['status']=false;
|
|
$res['msg']='状态修改失败';
|
|
}else{
|
|
$this->addnotice($apply_id);
|
|
}
|
|
return $res;
|
|
}
|
|
/**
|
|
* 古建资产清单
|
|
*/
|
|
public function capital_detail(){
|
|
$apply_id=input('apply_id');
|
|
$apply_type=input('apply_type');
|
|
$next_status=input('status');
|
|
|
|
$list=input('list','','htmlspecialchars_decode');
|
|
|
|
try {
|
|
$list=json_decode($list,true);
|
|
} catch (Exception $e) {
|
|
}
|
|
$res = array('status'=>true,'msg'=>'','url' => "/capital/Capital/apply_list".$next_status."?apply_type=".$apply_type);
|
|
if(empty($apply_id) || empty($list) || empty($next_status)||count($list)==0){
|
|
$res['status'] = false;
|
|
$res['msg'] = '缺少必要参数!';
|
|
}
|
|
|
|
$where=array('apply_id'=>$apply_id);
|
|
$applyinfo = Db::name('capitalapply')->where($where)->find();
|
|
//取得基本信息表
|
|
$baseinfo = Db::name('capitalbaseinfo')->where($where)->find();
|
|
|
|
return $res;
|
|
}
|
|
public function capital_check(){
|
|
$apply_id=input('apply_id');
|
|
$advice=input('advice');
|
|
$advice = htmlspecialchars_decode($advice);
|
|
$advice=strip_tags($advice);
|
|
$apply_status=input('apply_status');
|
|
$aid=session('admin_auth.aid');
|
|
$arole=session('admin_auth.role');
|
|
//古建托管
|
|
$products=input("products",'','htmlspecialchars_decode');
|
|
$ower=input('ower');
|
|
$cunit=input('capital_unit');
|
|
$cprice=input('capital_price','','intval');
|
|
$ccommission=input('capital_commission','');
|
|
|
|
$tgprice=input('tg_price','','intval');
|
|
$tgdate=input('tg_date');
|
|
$tgyear=input('tg_year','','intval');
|
|
|
|
$status=input('status');
|
|
$apply_type=input('apply_type');
|
|
$process=$this->process[$apply_type];
|
|
$index=array_search($status,$process);
|
|
if($status<90||$status==100)$index=$index+1;
|
|
$next_status=$process[$index];
|
|
|
|
$where=array('apply_id'=>$apply_id);
|
|
$applyinfo = Db::name('capitalapply')->where($where)->find();
|
|
//取得基本信息表
|
|
$baseinfo = Db::name('capitalbaseinfo')->where($where)->find();
|
|
$proassign=$baseinfo['proassign'];
|
|
$ass_agree=$baseinfo['ass_agree'];
|
|
if($apply_type==1&&$status==30&&$apply_status==1){
|
|
|
|
if(empty($tgprice)){
|
|
$res['status'] = false;
|
|
$res['msg'] = '请填写托管收费标准!';
|
|
return $res;
|
|
}
|
|
if(empty($tgdate)){
|
|
$res['status'] = false;
|
|
$res['msg'] = '请填写托管日期!';
|
|
return $res;
|
|
}
|
|
if(empty($tgyear)){
|
|
$res['status'] = false;
|
|
$res['msg'] = '请填写托管年数!';
|
|
return $res;
|
|
}
|
|
}
|
|
if(in_array($apply_type,[3,4])&&in_array($status,[10,20,60,70,90])&&$apply_status==1){
|
|
if(in_array($status,[20,60,70,90])){
|
|
if(empty($ower)){
|
|
$res['status'] = false;
|
|
$res['msg'] = '请选择信息所属人!';
|
|
return $res;
|
|
}
|
|
if($cunit==''){
|
|
$res['status'] = false;
|
|
$res['msg'] = '请填写收费标准!';
|
|
return $res;
|
|
}
|
|
if($cprice==''){
|
|
$res['status'] = false;
|
|
$res['msg'] = '请填写单价金额!';
|
|
return $res;
|
|
}
|
|
if($ccommission==''){
|
|
$res['status'] = false;
|
|
$res['msg'] = '请填写交易佣金!';
|
|
return $res;
|
|
}
|
|
$member=db('member_list')->where(['member_list_id'=>$ower])->find();
|
|
if(!$member){
|
|
$res['status'] = false;
|
|
$res['msg'] = '请选择信息所属人!';
|
|
return $res;
|
|
}
|
|
}
|
|
$param=request()->param();
|
|
$pid=isset($param['pid'])?$param['pid']:[];
|
|
$code=isset($param['code'])?$param['code']:[];
|
|
$capital_level=isset($param['capital_level'])?$param['capital_level']:[];
|
|
$capital_gprice=isset($param['capital_gprice'])?$param['capital_gprice']:[];
|
|
$capital_date=isset($param['capital_date'])?$param['capital_date']:[];
|
|
$other_info=isset($param['other_info'])?$param['other_info']:[];
|
|
$feedback=isset($param['feedback'])?$param['feedback']:[];
|
|
$len=count($pid);
|
|
|
|
$items=[];
|
|
for($i=0;$i<$len;$i++){
|
|
$item=[];
|
|
$iid=$pid[$i];
|
|
if($iid){
|
|
$item['id']=$pid[$i];
|
|
$item['code']=$code[$i];
|
|
$item['capital_level']=$capital_level[$i];
|
|
$item['capital_gprice']=$capital_gprice[$i];
|
|
$item['capital_date']=$capital_date[$i]?strtotime($capital_date[$i]):'';
|
|
$item['other_info']=$other_info[$i];
|
|
$item['feedback']=$feedback[$i];
|
|
array_push($items,$item);
|
|
}
|
|
}
|
|
if(count($items)){
|
|
$db=new Capitaldetail();
|
|
$db->saveAll($items);
|
|
}
|
|
}
|
|
|
|
if(in_array($apply_type,[3,4])&&in_array($status,[70,90])&&$apply_status==1){
|
|
$param=request()->param();
|
|
$pid=isset($param['pid'])?$param['pid']:[];
|
|
$deposit=isset($param['deposit'])?$param['deposit']:[];
|
|
$pay_amount=isset($param['pay_amount'])?$param['pay_amount']:[];
|
|
$pay_date=isset($param['pay_date'])?$param['pay_date']:[];
|
|
$len=count($pid);
|
|
|
|
$items=[];
|
|
for($i=0;$i<$len;$i++){
|
|
$item=[];
|
|
$iid=$pid[$i];
|
|
if($iid){
|
|
$item['id']=$pid[$i];
|
|
$item['deposit']=$deposit[$i];
|
|
$item['pay_amount']=$pay_amount[$i];
|
|
$item['pay_date']=$pay_date[$i]?$pay_date[$i]:'';
|
|
array_push($items,$item);
|
|
}
|
|
}
|
|
if(count($items)){
|
|
$db=new Capitaldetail();
|
|
$db->saveAll($items);
|
|
}
|
|
}
|
|
$this->assign('apply_type',$apply_type);
|
|
$res = array('status'=>true,'msg'=>'','url' => "/capital/Capital/apply_list".$status."?apply_type=".$apply_type);
|
|
if(empty($apply_id) || empty($advice) || empty($apply_status)){
|
|
$res['status'] = false;
|
|
$res['msg'] = '缺少必要参数!';
|
|
return $res;
|
|
}
|
|
if($applyinfo && $baseinfo){
|
|
if($apply_status == 1){
|
|
$res['msg'] = "审核通过";
|
|
if($status==40&&$apply_type==2){
|
|
|
|
$count=Db::name('capitalproassign')->where(['apply_id'=>$apply_id,'update_id'=>0,'del_flag'=>0])->count();
|
|
if($count){
|
|
$res['status'] = false;
|
|
$res['msg'] = "审核失败,专家未评分";
|
|
return $res;
|
|
}
|
|
}
|
|
}
|
|
|
|
if($apply_status == 2){
|
|
$res['msg'] = "审核不通过";
|
|
|
|
if(($status ==10||$status ==20)&&!in_array($apply_type,[2,3,4])){
|
|
$uptypeid=Db::name('capitaluptype')->where(['apply_type'=>$apply_type,'isopen'=>1,'apply_id'=>0])->column('ftype_id');
|
|
$count=Db::name('capital_upfiles')->where(['flag'=>0,'apply_id'=>$apply_id])->where('ftype_id','in',$uptypeid)->count();
|
|
$count2=Db::name('capital_upfiles')->where(['apply_id'=>$apply_id])->where('ftype_id','in',$uptypeid)->count();
|
|
if($count==0&&$count2){
|
|
$res['status'] = false;
|
|
$res['msg'] = "上传文件已全部通过,只能操作审核通过";
|
|
return $res;
|
|
}
|
|
}
|
|
}
|
|
|
|
$check_id = Capitalcheck::check_add($apply_id,$advice,$status);
|
|
|
|
$where = array("apply_id"=>$apply_id);
|
|
|
|
if($check_id){
|
|
if($apply_type==1&&$status==30){
|
|
$tgdate=($tgdate?strtotime($tgdate):'');
|
|
Db::name('capitalbaseinfo')->where(['apply_id'=>$apply_id])->update(['tg_year'=>$tgyear,'tg_price'=>$tgprice,'tg_date'=>$tgdate]);
|
|
}
|
|
if(in_array($apply_type,[3,4])&&$status>=20&&$apply_status==1&&$ower){
|
|
db('capitalapply')->where(['apply_id'=>$apply_id])->update(['user_id'=>$ower]);
|
|
Db::name('capitalbaseinfo')->where(['apply_id'=>$apply_id])->update(['capital_unit'=>$cunit,'capital_price'=>$cprice,'capital_commission'=>$ccommission]);
|
|
}
|
|
if($apply_type==1&&$status ==90&&$apply_status==1){
|
|
$htname=$baseinfo['hoster_name'];
|
|
|
|
//插入到前台公告
|
|
$contents=Options::get_options('cunotice_options',$this->lang);
|
|
$contents_title='中国文化资产托管公告:'.$htname.'';
|
|
$contents['content_tpl']=isset($contents['content_tpl'])?$contents['content_tpl']:'';
|
|
$notice=$contents['content_tpl'];
|
|
$notice=str_replace('#COMNAME#',$htname,$notice);
|
|
$notice=str_replace('#CODENAME#',$htname,$notice);
|
|
$notice=str_replace('#CODE#','',$notice);
|
|
$notice=str_replace('#DATE#',date("Y年m月d日"),$notice);
|
|
//生成公告
|
|
$sl_data=array(
|
|
'n_title'=>$contents_title,
|
|
'n_cid'=>3,
|
|
'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,
|
|
'n_kind'=>$baseinfo['apply_type'],
|
|
'n_img'=>'/data/upload/gjposter.jpg',
|
|
);
|
|
Db::name('bsgg')->insert($sl_data);
|
|
}
|
|
if($apply_type==3&&$status ==90&&$apply_status==1){
|
|
|
|
$products = Db::name('capitaldetail')->where($where)->select();
|
|
|
|
if(!empty($products)){
|
|
if(count($products)){
|
|
foreach ($products as $key=>$row){
|
|
$baseinfo_name=$row['capital_name'];
|
|
$ctitle='整体性古建构件';
|
|
|
|
$captype=$cap_type=$row['capital_type'];
|
|
$capchild=$cap_child=$row['capital_child'];
|
|
$capele=$row['capital_elem'];
|
|
$cclass=$row['capital_class'];
|
|
|
|
$year=$row['capital_year']?$row['capital_year']:'';
|
|
$land=$row['capital_land']?$row['capital_land']:'';
|
|
$rank=$row['capital_rank']?$row['capital_rank']:'';
|
|
$capele=$row['capital_elem'];
|
|
if($capele)$capele=explode(',',$capele);
|
|
$elems=['1'=>'资产所有权','资产使用权','资产收益权','资产租赁权'];
|
|
$years=['1'=>'明朝','清朝','民国','其它'];
|
|
$ranks=['1'=>'国家级','省级','市级','无'];
|
|
|
|
$classs=[1=>'徽派','晋派','京派','苏派','闽派 ','川派','岭南派','赣派','其他'];
|
|
$lands=['1'=>'商业用地','综合用地','住宅用地','工业用地','其它'];
|
|
|
|
if(isset($lands[$land])){
|
|
if($land==5){
|
|
$land=$lands[$land].':'.$row['land_other'];
|
|
}else{
|
|
$land=$lands[$land];
|
|
}
|
|
}
|
|
if(isset($classs[$cclass])){
|
|
if($cclass==9){
|
|
$cclass=$classs[$cclass].':'.$row['class_other'];
|
|
}else{
|
|
$cclass=$classs[$cclass];
|
|
}
|
|
}
|
|
if(isset($years[$year])){
|
|
if($year==4){
|
|
$year=$years[$year].':'.$row['year_other'];
|
|
}else{
|
|
$year=$years[$year];
|
|
}
|
|
}
|
|
|
|
if(is_array($capele)){
|
|
$elestr='';
|
|
foreach ($capele as $erow){
|
|
if(isset($elems[$erow])){
|
|
$elestr.=$elems[$erow].';';
|
|
}
|
|
}
|
|
$capele=rtrim($elestr,';');
|
|
}
|
|
|
|
$childs=config("building.childs");
|
|
|
|
if(isset($childs[$captype][$capchild]))$capchild=$childs[$captype][$capchild];
|
|
if(isset($elems[$capele]))$capele=$elems[$capele];
|
|
if(isset($ranks[$rank]))$rank=$ranks[$rank];
|
|
$cparent='';
|
|
if($captype==5){
|
|
$cap_type='构件类标的';
|
|
$cparent=1;
|
|
}
|
|
if($captype==15){
|
|
$cap_type='在建类古建标的';
|
|
$cparent=2;
|
|
}
|
|
if($captype==35){
|
|
$cap_type='仿古类古建标的';
|
|
$cparent=3;
|
|
}
|
|
if($captype==45){
|
|
$cap_type='产权类古建标的';
|
|
$cparent=4;
|
|
}
|
|
if($captype==55){
|
|
$cap_type='现存独立古建';
|
|
$cparent=5;
|
|
}
|
|
|
|
|
|
$html='<table width="100%" border="0" cellspacing="1" cellpadding="0" style="line-height:2.4em;background:rgba(230,226,231,1);">';
|
|
$td2='style="color:#8a8888;background:#fff;padding-left:10px;"';
|
|
|
|
$mor=($row['capital_mortgage']==1)?'是':'否';
|
|
$fields=[];
|
|
$sfields=[];
|
|
$html.='<tbody>';
|
|
array_push($fields,['资产名称',$row['capital_name']]);
|
|
array_push($fields,['资产托管代码',$row['code']]);
|
|
//array_push($fields,['古建资产类别',$cap_type]);
|
|
array_push($fields,['古建资产类别',$capchild]);
|
|
array_push($fields,['资产托管要素',$capele]);
|
|
$gpprice=$row['capital_gprice']?$row['capital_gprice'].'元':'';
|
|
array_push($fields,['本所指导价',$gpprice]);
|
|
$caprice=$row['capital_price']?$row['capital_price'].'元':'——';
|
|
array_push($sfields,['托管方报价',$caprice]);
|
|
$ccomm=isset($row['capital_commission'])&&$row['capital_commission']?$row['capital_commission'].'元':'——';
|
|
array_push($sfields,['交易佣金',$ccomm]);
|
|
array_push($sfields,['资产是否存在抵押情况',$mor]);
|
|
$level=$row['capital_level'];
|
|
array_push($sfields,['资产等级',$level]);
|
|
|
|
$info=($row['capital_info'])?$row['capital_info']:'';
|
|
if($info)$info=explode(',',$info);
|
|
$infos=['1'=>'有人居住','文旅开发','存在第三方机构','其它'];
|
|
if(is_array($info)){
|
|
$elestr='';
|
|
foreach ($info as $erow){
|
|
if(isset($infos[$erow])){
|
|
if($erow==4){
|
|
$elestr.=$infos[$erow].':'.$row['info_other'].';';
|
|
}else{
|
|
$elestr.=$infos[$erow].';';
|
|
}
|
|
}
|
|
}
|
|
$info=rtrim($elestr,';');
|
|
}
|
|
|
|
$carea=$row['capital_area']?$row['capital_area'].'平方米':'';
|
|
$cspace=$row['capital_space']?$row['capital_space'].'平方米':'';
|
|
|
|
$ccate=1;
|
|
if($captype==5){
|
|
array_push($sfields,['构件数量',$row['capital_num']]);
|
|
array_push($sfields,['古建资产年代',$year]);
|
|
if($cap_child=='A12'){
|
|
array_push($sfields,['构件类型',$row['capital_kind']]);
|
|
array_push($sfields,['构件材质',$row['capital_material']]);
|
|
array_push($sfields,['构件规格',$row['capital_size']]);
|
|
}else{
|
|
array_push($sfields,['古建资产风格',$cclass]);
|
|
array_push($sfields,['古建资产面积',$carea]);
|
|
array_push($sfields,['建筑材质',$row['capital_material']]);
|
|
array_push($sfields,['建筑规格',$row['capital_size']]);
|
|
}
|
|
}
|
|
if($captype==15){
|
|
$ccate=2;
|
|
array_push($sfields,['古建资产面积',$carea]);
|
|
array_push($sfields,['古建数量',$row['capital_num']]);
|
|
array_push($sfields,['古建资产风格',$cclass]);
|
|
array_push($sfields,['地理位置',$row['capital_location']]);
|
|
if($cap_child=='B1'){
|
|
array_push($sfields,['主建筑群建筑年代',$year]);
|
|
array_push($sfields,['土地性质',$land]);
|
|
array_push($sfields,['古建占地面积',$cspace]);
|
|
array_push($sfields,['现存古村、古镇、古街区现状',$info]);
|
|
array_push($sfields,['古村级别',$rank]);
|
|
}else{
|
|
array_push($sfields,['建筑年代',$year]);
|
|
array_push($sfields,['建筑材质',$row['capital_material']]);
|
|
array_push($sfields,['建筑规格',$row['capital_size']]);
|
|
}
|
|
}
|
|
if($captype==35){
|
|
$ccate=3;
|
|
array_push($sfields,['土地性质',$land]);
|
|
array_push($sfields,['古建资产面积',$carea]);
|
|
array_push($sfields,['房屋数量',$row['capital_num']]);
|
|
array_push($sfields,['园区配套设施',$row['capital_device']]);
|
|
array_push($sfields,['园区业态分布',$row['capital_major']]);
|
|
array_push($sfields,['房屋详细情况',$row['capital_detail']]);
|
|
}
|
|
|
|
if($captype==45){
|
|
$ccate=4;
|
|
array_push($sfields,['古建资产面积',$carea]);
|
|
if($cap_child=='D11'||$cap_child=='D12'){
|
|
array_push($sfields,['古建数量',$row['capital_num']]);
|
|
array_push($sfields,['土地性质',$land]);
|
|
array_push($sfields,['古建占地面积',$cspace]);
|
|
array_push($sfields,['地理位置',$row['capital_location']]);
|
|
array_push($sfields,['现存古村、古镇、古街区现状',$info]);
|
|
array_push($sfields,['古村级别',$rank]);
|
|
array_push($sfields,['主建筑群建筑年代',$year]);
|
|
}else{
|
|
array_push($sfields,['构件数量',$row['capital_num']]);
|
|
array_push($sfields,['古建资产年代',$year]);
|
|
array_push($sfields,['建筑材质',$row['capital_material']]);
|
|
array_push($sfields,['建筑规格',$row['capital_size']]);
|
|
}
|
|
|
|
array_push($sfields,['古建资产风格',$cclass]);
|
|
}
|
|
|
|
if($captype==55){
|
|
array_push($sfields,['地理位置',$row['capital_location']]);
|
|
array_push($sfields,['古建资产面积',$carea]);
|
|
//array_push($sfields,['建筑类型',$row['capital_kind']]);
|
|
array_push($sfields,['古建资产年代',$year]);
|
|
array_push($sfields,['建筑材质',$row['capital_material']]);
|
|
array_push($sfields,['建筑规格',$row['capital_size']]);
|
|
//array_push($sfields,['建筑层数',$row['capital_floor']]);
|
|
array_push($sfields,['古建资产风格',$cclass]);
|
|
}
|
|
$fields=array_merge($fields,$sfields);
|
|
$capdate=$row['capital_date']?date("Y-m-d",$row['capital_date']):'';
|
|
array_push($fields,['资产简介',$row['capital_desc']]);
|
|
array_push($fields,['托管日期(一年有效期)',$capdate]);
|
|
array_push($fields,['其他披露信息',$row['other_info']]);
|
|
|
|
if(count($fields)){
|
|
foreach ($fields as $field){
|
|
$html.='<tr><td width="200px" align="center" style="background:rgba(240,240,240,1);">'.$field[0].':</td><td '.$td2.'>'.$field[1].'</td></tr>';
|
|
}
|
|
}
|
|
|
|
$html.='</tbody></table>';
|
|
|
|
//插入到前台公告
|
|
$contents=Options::get_options('gjnotice_options',$this->lang);
|
|
$contents_title='中国古建资产托管公告:'.$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('#TABLELIST#',$html,$notice);
|
|
$deposit=$row['deposit'];
|
|
$deposit=($deposit==1)?'是':'否';
|
|
$notice=str_replace('#capital_type#',$cap_type,$notice);
|
|
$notice=str_replace('#deposit#',$deposit,$notice);
|
|
$notice=str_replace('#pay_amount#',$row['pay_amount'],$notice);
|
|
$paydate='意向受让方经资格确认后3个工作日内缴纳';//$row['pay_date']?$row['pay_date']:'';
|
|
$notice=str_replace('#pay_date#',$paydate,$notice);
|
|
|
|
$htype=$baseinfo['hoster_type']==1?'机构':'个人';
|
|
$notice=str_replace('#hoster_type#',$htype,$notice);
|
|
$notice=str_replace('#hoster_name#',$baseinfo['hoster_name'],$notice);
|
|
$addr=$baseinfo['company_addr'];
|
|
$eco=$baseinfo['eco_nature'];
|
|
if($baseinfo['hoster_type']==2){
|
|
$eco='——';
|
|
$addr=$baseinfo['natural_addr'];
|
|
}
|
|
$notice=str_replace('#company_addr#',$addr,$notice);
|
|
$notice=str_replace('#eco_nature#',$eco,$notice);
|
|
$notice=str_replace('#feedback#',$row['feedback'],$notice);
|
|
$notice=str_replace('#notice_date#',date("Y年m月d日"),$notice);
|
|
//生成公告
|
|
$sl_data=array(
|
|
'n_title'=>$contents_title,
|
|
'n_cid'=>3,
|
|
'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,
|
|
'n_kind'=>$baseinfo['apply_type'],
|
|
'n_img'=>'/data/upload/gjposter.jpg',
|
|
);
|
|
Db::name('bsgg')->insert($sl_data);
|
|
$clogo='';
|
|
$files=$row['capital_files'];
|
|
if($files){
|
|
$files=explode(';',$files);
|
|
if(is_array($files)){
|
|
$clogo=$files[0];
|
|
}
|
|
$files=implode(',', $files);
|
|
}
|
|
$stime=$row['capital_date'];
|
|
$endtime='';
|
|
if($stime){
|
|
$endtime=strtotime('+1 years',$stime);
|
|
}
|
|
$ccontent='<p class="pagetabs">
|
|
<a href="#info" class="active">资产简介</a>
|
|
<a href="#detail" >托管方简况</a>
|
|
<a href="#promise" >托管方承诺</a>
|
|
<a href="#rule" >交易条件与受让方资格条件</a>
|
|
<a href="#contract" >受托机构</a></p>';
|
|
$ccontent.='<a id="info"></a><table align="center" width="100%" border="0" cellspacing="1" cellpadding="0" style="line-height:36px;background:#dcdcdc;font-size:16px;">
|
|
<tbody><tr><td colspan="4" style="line-height:36px;background:rgba(240,240,240,1);color:#707070;" align="center"><strong>资产简介</strong></td></tr>
|
|
<tr><td colspan="4" style="line-height:36px;background:rgba(240,240,240,1);background:#fff;padding:15px 25px;color:#707070;" >'.$row['capital_desc'].'</td></tr>';
|
|
$html='';
|
|
if(count($sfields)){
|
|
$temp=[];
|
|
$str1=$str2='';
|
|
foreach ($sfields as $k=>$field){
|
|
if(count($temp)==4){
|
|
$ccontent.='<tr>'.$str1.'</tr><tr>'.$str2.'</tr>';
|
|
$str1=$str2='';
|
|
$temp=[];
|
|
}
|
|
$str1.='<td style="line-height:36px;background:rgba(240,240,240,1);color:#707070;width:25%;" align="center"><strong>'.$field[0].'</strong></td>';
|
|
$str2.='<td style="line-height:26px;background:#fff;color:#a0a0a0;padding:5px 10px;width:25%;" align="center">'.$field[1].'</td>';
|
|
array_push($temp,$field);
|
|
}
|
|
if(count($temp)){
|
|
$str1=$str2='';
|
|
foreach ($temp as $k=>$field){
|
|
$str1.='<td style="line-height:36px;background:rgba(240,240,240,1);color:#707070;width:25%;" align="center"><strong>'.$field[0].'</strong></td>';
|
|
$str2.='<td style="line-height:26px;background:#fff;color:#a0a0a0;padding:5px 10px;width:25%;" align="center">'.$field[1].'</td>';
|
|
}
|
|
|
|
for($i=1;$i<=(4-count($temp));$i++){
|
|
$str1.='<td style="line-height:36px;background:rgba(240,240,240,1);color:#707070;width:25%;" align="center"> </td>';
|
|
$str2.='<td style="line-height:26px;background:#fff;color:#a0a0a0;padding:5px 10px;width:25%;" align="center"> </td>';
|
|
}
|
|
$ccontent.='<tr>'.$str1.'</tr><tr>'.$str2.'</tr>';
|
|
}
|
|
}
|
|
|
|
$ccontent.='<tr><td colspan="4" style="line-height:36px;background:rgba(240,240,240,1);color:#707070;" align="center"><strong>其他披露信息</strong></td></tr>
|
|
<tr>
|
|
<td colspan="4" style="line-height:36px;background:rgba(240,240,240,1);background:#fff;padding:15px 25px;color:#707070;" >'.$row['other_info'].'</td>
|
|
</tr></tbody></table><br/><br/>';
|
|
$ccontent.='<a id="detail"></a><table align="center" width="100%" border="0" cellspacing="1" cellpadding="0" style="line-height:36px;background:#dcdcdc;font-size:16px;"><tbody><tr><td colspan="2" style="line-height:36px;background:rgba(240,240,240,1);color:#707070;" align="center"><strong>托管方简况</strong></td></tr>
|
|
<tr><td style="line-height:36px;background:#fff;color:#a0a0a0;width:440px" align="center"> 托管方名称 </td>
|
|
<td style="line-height:36px;background:#fff;color:#a0a0a0;padding:0px 10px;">'.$baseinfo['hoster_name'].'</td>
|
|
</tr>
|
|
<tr><td style="line-height:36px;background:#fff;color:#a0a0a0;width:440px" align="center"> 注册地(住所) </td>
|
|
<td style="line-height:36px;background:#fff;color:#a0a0a0;padding:0px 10px;">'.$addr.'</td>
|
|
</tr>
|
|
<tr><td style="line-height:36px;background:#fff;color:#a0a0a0;width:440px" align="center"> 公司类型(经济性质) </td>
|
|
<td style="line-height:36px;background:#fff;color:#a0a0a0;padding:0px 10px;">'.$eco.'</td>
|
|
</tr>
|
|
<tr><td style="line-height:24px;padding:10px 25px;background:#fff;color:#a0a0a0;width:390px" align="center"> 审计报告和评估报告中的保留意见、重要揭示、<br/> 特别事项说明中涉及托管标的提示提醒等内容 </td>
|
|
<td style="line-height:36px;background:#fff;color:#a0a0a0;padding:0px 10px;">'.$row['feedback'].'</td>
|
|
</tr></tbody></table><br/><br/>';
|
|
$ccontent.='<a id="promise"></a><table align="center" width="100%" border="0" cellspacing="1" cellpadding="0" style="line-height:36px;background:#dcdcdc;font-size:16px;"><tbody><tr><td style="line-height:36px;background:rgba(240,240,240,1);color:#707070;" align="center"><strong>中国古建资产交易平台托管方承诺</strong></td></tr><tr class="firstRow">
|
|
<td style="padding:20px 15px;background:#fff;color:#a0a0a0;">本公司/本人自愿将持有的古建资产托管于深圳文化产权交易所古建资产管理中心中国古建资产托管交易平台,现就标的资产相关事宜作如下承诺:<br/>1、本次托管资产不存在任何权属纠纷,不存在质押、抵押、其他担保或第三方权益或限制情形,亦不存在法院或其他有权机关冻结、查封、拍卖之情形。托管资产交付或者转移不存在法律障碍。<br/>
|
|
2、本公司/本人向贵所提供的文件、证件及有关附件材料真实、合法、有效,复印文本与原件一致,并对因提交虚假文件、证件所引发的一切后果承担相应的法律责任。<br/>本公司/本人保证遵守以上承诺,如违反上述承诺或有违规行为,给深圳文化产权交易所或交易相关方造成损失的,愿意承担法律责任及相应的经济赔偿责任。<br/></td></tr></tbody></table><br/><br/>';
|
|
$ccontent.='<a id="rule"></a><table align="center" width="100%" border="0" cellspacing="1" cellpadding="0" style="line-height:36px;background:#dcdcdc;font-size:16px;"><tbody><tr><td colspan="3" style="line-height:36px;background:rgba(240,240,240,1);color:#707070;" align="center"><strong>交易条件与受让方资格条件</strong></td></tr>
|
|
<tr class="firstRow"><td valign="middle" style="width:300px;background:#fff;color:#a0a0a0;" rowspan="2" align="center">交易条件</td><td style="width:300px;line-height:36px;background:#fff;color:#a0a0a0;" rowspan="1" align="center" valign="middle">交易价款支付方式</td><td valign="middle" style="line-height:36px;color:#8a8888;background:#fff;padding-left:10px;" align="left">一次性支付</td>
|
|
</tr><tr><td valign="middle" rowspan="1" style="width:300px;line-height:36px;background:#fff;color:#a0a0a0;" align="center">受让方资格条件</td>
|
|
<td valign="middle" style="line-height:36px;color:#8a8888;background:#fff;padding:0px 10px;" align="left">1、意向受让方应为依法设立并有效存续的企业法人、其他经济组织或自然人。<br>2、意向受让方具有良好的商业信用。<br>3、意向受让方应具有良好的财务状况和支付能力。<br>4、意向受让方向深圳文化产权交易所提供的文件、证件及有关附件材料真实、合法、有效,复印文本与原件一致。<br>5、符合国家法律、行政法规规定的其他条件。</td></tr></tbody></table><br/><br/>';
|
|
$ccontent.='<a id="contract"></a><table align="center" width="100%" border="0" cellspacing="1" cellpadding="0" style="line-height:36px;background:#dcdcdc;font-size:16px;"><tbody><tr><td colspan="2" style="line-height:36px;background:rgba(240,240,240,1);color:#707070;" align="center"><strong>受托机构</strong></td></tr><tr class="firstRow">
|
|
<td valign="top" style="width:300px;line-height:36px;background:#fff;color:#a0a0a0;" align="center">受托机构名称</td><td valign="middle" style="line-height:36px;background:#fff;color:#a0a0a0;padding-left:10px;" align="center">深圳文化产权交易所有限公司</td></tr><tr>
|
|
<td valign="top" style="width:300px;line-height:36px;color:#a0a0a0;background:#fff;" align="center">联系电话</td><td valign="middle" style="line-height:36px;background:#fff;color:#a0a0a0;padding-left:10px;" align="center">0755—88266839</td></tr></tbody></table>';
|
|
//生成托管资产的展示
|
|
$sl_data=array(
|
|
'c_name'=>$baseinfo_name,
|
|
'c_mold'=>0,
|
|
'c_price'=>$row['capital_price'],
|
|
'c_cid'=>'',
|
|
'c_code'=>$row['code'],
|
|
'c_gptime'=>$row['capital_date'],
|
|
'c_time'=>$row['create_time'],
|
|
'c_uid'=>session('admin_auth.aid'),
|
|
'c_status'=>1,
|
|
'c_type'=>'',
|
|
'c_kind'=>11,
|
|
'c_gprice'=>$row['capital_gprice'],
|
|
'c_infostime'=>$row['capital_date'],
|
|
'c_infoetime'=>$endtime,
|
|
'c_size'=>$row['capital_size'],
|
|
'c_cate'=>$ccate,
|
|
'c_material'=>$row['capital_material'],
|
|
'c_year'=>$row['capital_year'],
|
|
'c_class'=>$row['capital_class'],
|
|
'c_photos'=>$files,
|
|
'c_num'=>$row['capital_num'],
|
|
'c_parent'=>$cparent,
|
|
'c_child'=>'',
|
|
'c_endtime'=>$endtime,
|
|
'c_logo'=>$clogo,
|
|
'c_content'=>$row['capital_desc'],
|
|
'capital_desc'=>$ccontent,
|
|
'capital_level'=>$row['capital_level'],
|
|
'capital_elem'=>$row['capital_elem'],
|
|
'capital_area'=>$row['capital_area'],
|
|
'capital_detail'=>$row['capital_detail'],
|
|
'capital_major'=>$row['capital_major'],
|
|
'capital_device'=>$row['capital_device'],
|
|
'capital_location'=>$row['capital_location'],
|
|
'capital_info'=>$row['capital_info'],
|
|
'capital_kind'=>$row['capital_kind'],
|
|
'capital_space'=>$row['capital_space'],
|
|
'capital_rank'=>$row['capital_rank'],
|
|
'capital_land'=>$row['capital_land'],
|
|
'info_other'=>$row['info_other'],
|
|
'year_other'=>$row['year_other'],
|
|
'class_other'=>$row['class_other'],
|
|
'land_other'=>$row['land_other'],
|
|
'capital_mortgage'=>$row['capital_mortgage'],
|
|
'mortgage_img'=>$row['mortgage_img']
|
|
);
|
|
Db::name('finance')->insert($sl_data);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if($apply_type==4&&$status ==90&&$apply_status==1){
|
|
|
|
$products = Db::name('capitaldetail')->where($where)->select();
|
|
|
|
if(!empty($products)){
|
|
if(count($products)){
|
|
foreach ($products as $key=>$row){
|
|
$baseinfo_name=$row['capital_name'];
|
|
$ctitle='整体性构件';
|
|
|
|
$captype=$cap_type=$row['capital_type'];
|
|
$capchild=$cap_child=$row['capital_child'];
|
|
$capele=$row['capital_elem'];
|
|
|
|
$year=$row['capital_year']?$row['capital_year']:'';
|
|
$capele=$row['capital_elem'];
|
|
if($capele)$capele=explode(',',$capele);
|
|
$elems=['1'=>'资产所有权','资产使用权','资产收益权','资产租赁权'];
|
|
$years=['1'=>'明朝','清朝','民国','其它'];
|
|
|
|
if(isset($years[$year])){
|
|
if($year==4){
|
|
$year=$years[$year].':'.$row['year_other'];
|
|
}else{
|
|
$year=$years[$year];
|
|
}
|
|
}
|
|
|
|
if(is_array($capele)){
|
|
$elestr='';
|
|
foreach ($capele as $erow){
|
|
if(isset($elems[$erow])){
|
|
$elestr.=$elems[$erow].';';
|
|
}
|
|
}
|
|
$capele=rtrim($elestr,';');
|
|
}
|
|
|
|
$childs=config("building.childs2");
|
|
|
|
if(isset($childs[$captype][$capchild]))$capchild=$childs[$captype][$capchild];
|
|
if(isset($elems[$capele]))$capele=$elems[$capele];
|
|
$cparent='';
|
|
|
|
if($captype==5){
|
|
$cap_type='资产资源类 ';
|
|
$cparent=1;
|
|
}
|
|
if($captype==15){
|
|
$cap_type='商品版权类';
|
|
$cparent=2;
|
|
}
|
|
if($captype==35){
|
|
$cap_type='项目类';
|
|
$cparent=3;
|
|
}
|
|
|
|
$html='<table width="100%" border="0" cellspacing="1" cellpadding="0" style="line-height:2.4em;background:rgba(230,226,231,1);">';
|
|
$td2='style="color:#8a8888;background:#fff;padding-left:10px;"';
|
|
|
|
$nkind=4;
|
|
$ctitle="金溪专区";
|
|
$platform='乡村振兴要素交易平台';
|
|
if($row['capital_kind']==2){
|
|
$ctitle="德化专区";
|
|
}
|
|
if($row['capital_kind']==3){
|
|
$ctitle="乡村振兴";
|
|
}
|
|
|
|
$mor=($row['capital_mortgage']==1)?'是':'否';
|
|
$fields=[];
|
|
$sfields=[];
|
|
$html.='<tbody>';
|
|
array_push($fields,['资产名称',$row['capital_name']]);
|
|
array_push($fields,['资产托管代码',$row['code']]);
|
|
array_push($sfields,['资产类别',$capchild]);
|
|
array_push($fields,['资产托管要素',$capele]);
|
|
$gpprice=$row['capital_gprice']?$row['capital_gprice'].'元':'';
|
|
array_push($fields,['本所指导价',$gpprice]);
|
|
$caprice=$row['capital_price']?$row['capital_price'].'元':'——';
|
|
array_push($sfields,['托管方报价',$caprice]);
|
|
//array_push($sfields,['专区',$ctitle]);
|
|
// $ccomm=isset($row['capital_commission'])&&$row['capital_commission']?$row['capital_commission'].'元':'——';
|
|
//array_push($sfields,['交易佣金',$ccomm]);
|
|
|
|
$capnum=$row['capital_num']?$row['capital_num']:'1';
|
|
array_push($sfields,['资产数量',$capnum]);
|
|
|
|
$carea=$row['capital_area']?$row['capital_area'].'平方米':'';
|
|
array_push($sfields,['资产面积',$carea]);
|
|
|
|
$caploc=$row['capital_location']?$row['capital_location']:'——';
|
|
array_push($sfields,['地理位置',$caploc]);
|
|
$level=$row['capital_level'];
|
|
// array_push($sfields,['资产等级',$level]);
|
|
array_push($sfields,['资产年代',$year]);
|
|
|
|
array_push($sfields,['资产是否存在抵押情况',$mor]);
|
|
|
|
$ccate=1;
|
|
|
|
$fields=array_merge($fields,$sfields);
|
|
$capdate=$row['capital_date']?date("Y-m-d",$row['capital_date']):'';
|
|
array_push($fields,['资产简介',$row['capital_desc']]);
|
|
array_push($fields,['托管日期(一年有效期)',$capdate]);
|
|
array_push($fields,['其他披露信息',$row['other_info']]);
|
|
|
|
if(count($fields)){
|
|
foreach ($fields as $field){
|
|
$html.='<tr><td width="200px" align="center" style="background:rgba(240,240,240,1);">'.$field[0].':</td><td '.$td2.'>'.$field[1].'</td></tr>';
|
|
}
|
|
}
|
|
|
|
$html.='</tbody></table>';
|
|
|
|
|
|
//插入到前台公告
|
|
$contents=Options::get_options('xcnotice_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('#AREATITLE#',$ctitle,$notice);
|
|
$notice=str_replace('#TABLELIST#',$html,$notice);
|
|
$deposit=$row['deposit'];
|
|
$deposit=($deposit==1)?'是':'否';
|
|
$notice=str_replace('#capital_type#',$cap_type,$notice);
|
|
$notice=str_replace('#deposit#',$deposit,$notice);
|
|
$notice=str_replace('#pay_amount#',$row['pay_amount'],$notice);
|
|
$paydate='意向受让方经资格确认后3个工作日内缴纳';//$row['pay_date']?$row['pay_date']:'';
|
|
$notice=str_replace('#pay_date#',$paydate,$notice);
|
|
|
|
$htype=$baseinfo['hoster_type']==1?'机构':'个人';
|
|
$notice=str_replace('#hoster_type#',$htype,$notice);
|
|
$notice=str_replace('#hoster_name#',$baseinfo['hoster_name'],$notice);
|
|
$addr=$baseinfo['company_addr'];
|
|
$eco=$baseinfo['eco_nature'];
|
|
if($baseinfo['hoster_type']==2){
|
|
$eco='——';
|
|
$addr=$baseinfo['natural_addr'];
|
|
}
|
|
$notice=str_replace('#company_addr#',$addr,$notice);
|
|
$notice=str_replace('#eco_nature#',$eco,$notice);
|
|
$notice=str_replace('#feedback#',$row['feedback'],$notice);
|
|
$notice=str_replace('#notice_date#',date("Y年m月d日"),$notice);
|
|
|
|
//生成公告
|
|
$sl_data=array(
|
|
'n_title'=>$contents_title,
|
|
'n_cid'=>3,
|
|
'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,
|
|
'n_kind'=>$nkind,
|
|
'n_img'=>'',
|
|
);
|
|
Db::name('bsgg')->insert($sl_data);
|
|
|
|
$clogo='';
|
|
$files=$row['capital_files'];
|
|
if($files){
|
|
$files=explode(';',$files);
|
|
if(is_array($files)){
|
|
$clogo=$files[0];
|
|
}
|
|
$files=implode(',', $files);
|
|
}
|
|
$stime=$row['capital_date'];
|
|
$endtime='';
|
|
if($stime){
|
|
$endtime=strtotime('+1 years',$stime);
|
|
}
|
|
$htype=$baseinfo['hoster_type']==1?'机构':'个人';
|
|
$ccontent='<p>由'.$htype.'委托在本所'.$platform.'托管的"'.$baseinfo_name.'"已完成托管手续。</p><p class="pagetabs">
|
|
<a href="#info" class="active">资产简介</a>
|
|
<a href="#detail" >托管方简况</a>
|
|
<a href="#promise" >托管方承诺</a>
|
|
<a href="#rule" >交易条件与受让方资格条件</a>
|
|
<a href="#contract" >受托机构</a></p>';
|
|
$ccontent.='<a id="info"></a><table align="center" width="100%" border="0" cellspacing="1" cellpadding="0" style="line-height:36px;background:#dcdcdc;font-size:16px;">
|
|
<tbody><tr><td colspan="4" style="line-height:36px;background:rgba(240,240,240,1);color:#707070;" align="center"><strong>资产简介</strong></td></tr>
|
|
<tr><td colspan="4" style="line-height:36px;background:rgba(240,240,240,1);background:#fff;padding:15px 25px;color:#707070;" >'.$row['capital_desc'].'</td></tr>';
|
|
$html='';
|
|
if(count($sfields)){
|
|
$temp=[];
|
|
$str1=$str2='';
|
|
foreach ($sfields as $k=>$field){
|
|
if(count($temp)==4){
|
|
$ccontent.='<tr>'.$str1.'</tr><tr>'.$str2.'</tr>';
|
|
$str1=$str2='';
|
|
$temp=[];
|
|
}
|
|
$str1.='<td style="line-height:36px;background:rgba(240,240,240,1);color:#707070;width:25%;" align="center"><strong>'.$field[0].'</strong></td>';
|
|
$str2.='<td style="line-height:26px;background:#fff;color:#a0a0a0;padding:5px 10px;width:25%;" align="center">'.$field[1].'</td>';
|
|
array_push($temp,$field);
|
|
}
|
|
if(count($temp)){
|
|
$str1=$str2='';
|
|
foreach ($temp as $k=>$field){
|
|
$str1.='<td style="line-height:36px;background:rgba(240,240,240,1);color:#707070;width:25%;" align="center"><strong>'.$field[0].'</strong></td>';
|
|
$str2.='<td style="line-height:26px;background:#fff;color:#a0a0a0;padding:5px 10px;width:25%;" align="center">'.$field[1].'</td>';
|
|
}
|
|
|
|
for($i=1;$i<=(4-count($temp));$i++){
|
|
$str1.='<td style="line-height:36px;background:rgba(240,240,240,1);color:#707070;width:25%;" align="center"> </td>';
|
|
$str2.='<td style="line-height:26px;background:#fff;color:#a0a0a0;padding:5px 10px;width:25%;" align="center"> </td>';
|
|
}
|
|
$ccontent.='<tr>'.$str1.'</tr><tr>'.$str2.'</tr>';
|
|
}
|
|
}
|
|
|
|
$ccontent.='<tr><td colspan="4" style="line-height:36px;background:rgba(240,240,240,1);color:#707070;" align="center"><strong>其他披露信息</strong></td></tr>
|
|
<tr>
|
|
<td colspan="4" style="line-height:36px;background:rgba(240,240,240,1);background:#fff;padding:15px 25px;color:#707070;" >'.$row['other_info'].'</td>
|
|
</tr></tbody></table><br/><br/>';
|
|
$ccontent.='<a id="detail"></a><table align="center" width="100%" border="0" cellspacing="1" cellpadding="0" style="line-height:36px;background:#dcdcdc;font-size:16px;"><tbody><tr><td colspan="2" style="line-height:36px;background:rgba(240,240,240,1);color:#707070;" align="center"><strong>托管方简况</strong></td></tr>
|
|
<tr><td style="line-height:36px;background:#fff;color:#a0a0a0;width:440px" align="center"> 托管方名称 </td>
|
|
<td style="line-height:36px;background:#fff;color:#a0a0a0;padding:0px 10px;">'.$baseinfo['hoster_name'].'</td>
|
|
</tr>
|
|
<tr><td style="line-height:36px;background:#fff;color:#a0a0a0;width:440px" align="center"> 注册地(住所) </td>
|
|
<td style="line-height:36px;background:#fff;color:#a0a0a0;padding:0px 10px;">'.$addr.'</td>
|
|
</tr>
|
|
<tr><td style="line-height:36px;background:#fff;color:#a0a0a0;width:440px" align="center"> 公司类型(经济性质) </td>
|
|
<td style="line-height:36px;background:#fff;color:#a0a0a0;padding:0px 10px;">'.$eco.'</td>
|
|
</tr>
|
|
<tr><td style="line-height:24px;padding:10px 25px;background:#fff;color:#a0a0a0;width:390px" align="center"> 审计报告和评估报告中的保留意见、重要揭示、<br/> 特别事项说明中涉及托管标的提示提醒等内容 </td>
|
|
<td style="line-height:36px;background:#fff;color:#a0a0a0;padding:0px 10px;">'.$row['feedback'].'</td>
|
|
</tr></tbody></table><br/><br/>';
|
|
|
|
$ccontent.='<a id="promise"></a><table align="center" width="100%" border="0" cellspacing="1" cellpadding="0" style="line-height:36px;background:#dcdcdc;font-size:16px;"><tbody><tr><td style="line-height:36px;background:rgba(240,240,240,1);color:#707070;" align="center"><strong>托管方承诺</strong></td></tr><tr class="firstRow">
|
|
<td style="padding:20px 15px;background:#fff;color:#a0a0a0;">本公司/本人自愿将持有的'.str_replace(array('要素交易平台','资产托管交易平台'),'资产', $platform).'托管于深圳文化产权交易所'.$platform.',现就标的资产相关事宜作如下承诺:<br/>1、本次托管资产不存在任何权属纠纷,不存在质押、抵押、其他担保或第三方权益或限制情形,亦不存在法院或其他有权机关冻结、查封、拍卖之情形。托管资产交付或者转移不存在法律障碍。<br/>
|
|
2、本公司/本人向贵所提供的文件、证件及有关附件材料真实、合法、有效,复印文本与原件一致,并对因提交虚假文件、证件所引发的一切后果承担相应的法律责任。<br/>本公司/本人保证遵守以上承诺,如违反上述承诺或有违规行为,给深圳文化产权交易所或交易相关方造成损失的,愿意承担法律责任及相应的经济赔偿责任。<br/></td></tr></tbody></table><br/><br/>';
|
|
$ccontent.='<a id="rule"></a><table align="center" width="100%" border="0" cellspacing="1" cellpadding="0" style="line-height:36px;background:#dcdcdc;font-size:16px;"><tbody><tr><td colspan="3" style="line-height:36px;background:rgba(240,240,240,1);color:#707070;" align="center"><strong>交易条件与受让方资格条件</strong></td></tr>
|
|
<tr class="firstRow"><td valign="middle" style="width:300px;background:#fff;color:#a0a0a0;" rowspan="2" align="center">交易条件</td><td style="width:300px;line-height:36px;background:#fff;color:#a0a0a0;" rowspan="1" align="center" valign="middle">交易价款支付方式</td><td valign="middle" style="line-height:36px;color:#8a8888;background:#fff;padding-left:10px;" align="left">一次性支付</td>
|
|
</tr><tr><td valign="middle" rowspan="1" style="width:300px;line-height:36px;background:#fff;color:#a0a0a0;" align="center">受让方资格条件</td>
|
|
<td valign="middle" style="line-height:36px;color:#8a8888;background:#fff;padding:0px 10px;" align="left">1、意向受让方应为依法设立并有效存续的企业法人、其他经济组织或自然人。<br>2、意向受让方具有良好的商业信用。<br>3、意向受让方应具有良好的财务状况和支付能力。<br>4、意向受让方向深圳文化产权交易所提供的文件、证件及有关附件材料真实、合法、有效,复印文本与原件一致。<br>5、符合国家法律、行政法规规定的其他条件。</td></tr></tbody></table><br/><br/>';
|
|
$ccontent.='<a id="contract"></a><table align="center" width="100%" border="0" cellspacing="1" cellpadding="0" style="line-height:36px;background:#dcdcdc;font-size:16px;"><tbody><tr><td colspan="2" style="line-height:36px;background:rgba(240,240,240,1);color:#707070;" align="center"><strong>受托机构</strong></td></tr><tr class="firstRow">
|
|
<td valign="top" style="width:300px;line-height:36px;background:#fff;color:#a0a0a0;" align="center">受托机构名称</td><td valign="middle" style="line-height:36px;background:#fff;color:#a0a0a0;padding-left:10px;" align="center">深圳文化产权交易所有限公司</td></tr><tr>
|
|
<td valign="top" style="width:300px;line-height:36px;color:#a0a0a0;background:#fff;" align="center">联系电话</td><td valign="middle" style="line-height:36px;background:#fff;color:#a0a0a0;padding-left:10px;" align="center">0755—88266839</td></tr></tbody></table>';
|
|
|
|
//生成托管资产的展示
|
|
$ckind=15;
|
|
$ctype=2;
|
|
$ccid='';
|
|
if($row['capital_kind']==2){
|
|
$ctype=1;
|
|
}
|
|
if($row['capital_kind']==3){
|
|
$ctype='';
|
|
}
|
|
|
|
$sl_data=array(
|
|
'c_name'=>$baseinfo_name,
|
|
'c_mold'=>0,
|
|
'c_price'=>$row['capital_price'],
|
|
'c_cid'=>$ccid,
|
|
'c_code'=>$row['code'],
|
|
'c_gptime'=>$row['capital_date'],
|
|
'c_time'=>$row['create_time'],
|
|
'c_uid'=>session('admin_auth.aid'),
|
|
'c_status'=>1,
|
|
'c_type'=>$ctype,
|
|
'c_kind'=>$ckind,
|
|
'c_gprice'=>$row['capital_gprice'],
|
|
'c_infostime'=>$row['capital_date'],
|
|
'c_infoetime'=>$endtime,
|
|
'c_size'=>$row['capital_size'],
|
|
'c_cate'=>$ccate,
|
|
'c_year'=>$row['capital_year'],
|
|
'c_photos'=>$files,
|
|
'c_num'=>$row['capital_num'],
|
|
'c_parent'=>$cparent,
|
|
'c_child'=>'',
|
|
'c_endtime'=>$endtime,
|
|
'c_logo'=>$clogo,
|
|
'c_content'=>$row['capital_desc'],
|
|
'capital_desc'=>$ccontent,
|
|
'capital_elem'=>$row['capital_elem'],
|
|
'capital_level'=>'',//$row['capital_level'],
|
|
'capital_area'=>$row['capital_area'],
|
|
'capital_location'=>$row['capital_location'],
|
|
'info_other'=>$row['info_other'],
|
|
'year_other'=>$row['year_other'],
|
|
'capital_mortgage'=>$row['capital_mortgage'],
|
|
'mortgage_img'=>$row['mortgage_img']
|
|
);
|
|
Db::name('finance')->insert($sl_data);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
if($apply_status == 2){
|
|
$data= array("status"=>$status,"apply_status"=>$apply_status,"update_time"=>time());
|
|
}else{
|
|
$data= array("status"=>$next_status,"apply_status"=>0);
|
|
if($status == 90){
|
|
$data= array("status"=>$next_status,"apply_status"=>$apply_status);
|
|
}
|
|
if($status == 60){
|
|
$fee= array("fee_flag"=>1,"update_time"=>time());
|
|
Capitalfee::update($fee,$where);
|
|
// if($apply_type==3)$data['apply_status']=1;
|
|
}
|
|
}
|
|
Capitalapply::update($data,$where);
|
|
$apply_type=intval($apply_type);
|
|
$status=intval($status);
|
|
$task=intval($baseinfo['task']);
|
|
//加入任务
|
|
|
|
if($apply_type==3&&$status==70&&$task==0){
|
|
$param=[];
|
|
$param['apply_id']=$apply_id;
|
|
$param['base_id']=$baseinfo['base_id'];
|
|
$param['create_time']=time();
|
|
$param['step']=1;
|
|
$account_type=$baseinfo['hoster_type']==1?2:1;
|
|
$name=$cardno=$mobile=$business_code=$cpname='';
|
|
if($baseinfo['hoster_type']==1){
|
|
$name=$baseinfo['legal_person'];
|
|
$cardno=$baseinfo['legal_cardno'];
|
|
$mobile=$baseinfo['natural_tel'];
|
|
$business_code=$baseinfo['business_code'];
|
|
$cpname=$baseinfo['company_name'];
|
|
}else{
|
|
$name=$baseinfo['natural_name'];
|
|
$cardno=$baseinfo['leader_cardno'];
|
|
$mobile=$baseinfo['natural_tel'];
|
|
}
|
|
$ip_file=$in_file=$pa_file=$cc_file=$cd_file='';
|
|
$files=Db::name('capital_upfiles')->field('filesize,path,ftype_id')->where(['ftype_id'=>['in',[42,43,44,36]],'flag'=>1])->select();
|
|
if(count($files)){
|
|
foreach ($files as $row){
|
|
if($row['ftype_id']==42)$ip_file=SITE_PATH.$row['path'];//身份证正碳
|
|
if($row['ftype_id']==43)$in_file=SITE_PATH.$row['path'];//身份证反面
|
|
if($row['ftype_id']==44)$pa_file=realpath($row['path']);//委托书
|
|
if($row['ftype_id']==36)$cc_file=realpath($row['path']);//营业执照
|
|
if($row['ftype_id']==36)$cd_file=SITE_PATH.$row['path'];//营业执照
|
|
}
|
|
}
|
|
$time=(string)date("YmdHis");
|
|
$signId=uniqid('sign_');
|
|
$autoId=uniqid('auto_');
|
|
$conId=uniqid('con_');
|
|
$tplId=config('tplId');
|
|
$tranId=uniqid('dep_');
|
|
|
|
$info=['num'=>$baseinfo['capital_num'],'capital_type'=>$baseinfo['capital_type'],'capital_child'=>$baseinfo['capital_child'],'account_type'=>$account_type,'orgname'=>$baseinfo['hoster_name'],'name'=>$name,'addr'=>$baseinfo['natural_addr'],
|
|
'company_name'=>$cpname,'verified_time'=>$time,'cardno'=>$cardno,'mobile'=>$mobile,'cc_file'=>$cc_file,'cd_file'=>$cd_file,
|
|
'ip_file'=>$ip_file,'in_file'=>$in_file,'pa_file'=>$pa_file,'business_code'=>$business_code];
|
|
$param['info']=json_encode($info);
|
|
$param['tpl_id']=$tplId;
|
|
$param['sign_id']=$signId;
|
|
$param['con_id']=$conId;
|
|
$param['auto_id']=$autoId;
|
|
$param['tran_id']=$tranId;
|
|
$param['apply_type']=$apply_type;
|
|
$param['flag']=1;
|
|
|
|
Db::name('capitaltask')->insert($param);
|
|
Db::name('capitalbaseinfo')->where(['apply_id'=>$apply_id])->update(['task'=>1]);
|
|
}
|
|
if($apply_type==1&&$status==80&&$task==0){
|
|
|
|
$param=[];
|
|
$param['apply_id']=$apply_id;
|
|
$param['base_id']=$baseinfo['base_id'];
|
|
$param['create_time']=time();
|
|
$param['step']=1;
|
|
$account_type=$baseinfo['hoster_type']==1?2:1;
|
|
$name=$cardno=$mobile=$business_code=$cpname='';
|
|
if($baseinfo['hoster_type']==1){
|
|
$name=$baseinfo['legal_person'];
|
|
$cardno=$baseinfo['legal_cardno'];
|
|
$mobile=$baseinfo['natural_tel'];
|
|
$business_code=$baseinfo['business_code'];
|
|
$cpname=$baseinfo['company_name'];
|
|
}else{
|
|
$name=$baseinfo['leader_name'];
|
|
$cardno=$baseinfo['leader_cardno'];
|
|
$mobile=$baseinfo['natural_tel'];
|
|
}
|
|
$ip_file=$in_file=$pa_file=$cc_file=$cd_file='';
|
|
$files=Db::name('capital_upfiles')->field('filesize,path,ftype_id')->where(['ftype_id'=>['in',[16,45,19,15]],'flag'=>1])->select();
|
|
if(count($files)){
|
|
foreach ($files as $row){
|
|
if($row['ftype_id']==16)$ip_file=SITE_PATH.$row['path'];//身份证正碳
|
|
if($row['ftype_id']==45)$in_file=SITE_PATH.$row['path'];//身份证反面
|
|
if($row['ftype_id']==19)$pa_file=realpath($row['path']);//委托书
|
|
if($row['ftype_id']==15)$cc_file=realpath($row['path']);//营业执照
|
|
if($row['ftype_id']==15)$cd_file=SITE_PATH.$row['path'];//营业执照
|
|
}
|
|
}
|
|
$time=(string)date("YmdHis");
|
|
$signId=uniqid('sign_');
|
|
$autoId=uniqid('auto_');
|
|
$conId=uniqid('con_');
|
|
$tplId=config('tplId2');
|
|
$tranId=uniqid('dep_');
|
|
|
|
$info=['num'=>$baseinfo['capital_num'],'capital_type'=>$baseinfo['capital_type'],'capital_child'=>$baseinfo['capital_child'],'account_type'=>$account_type,'orgname'=>$baseinfo['hoster_name'],'name'=>$name,'addr'=>$baseinfo['natural_addr'],
|
|
'company_name'=>$cpname,'verified_time'=>$time,'cardno'=>$cardno,'mobile'=>$mobile,'cc_file'=>$cc_file,'cd_file'=>$cd_file,
|
|
'ip_file'=>$ip_file,'in_file'=>$in_file,'pa_file'=>$pa_file,'business_code'=>$business_code];
|
|
$param['info']=json_encode($info);
|
|
$param['tpl_id']=$tplId;
|
|
$param['sign_id']=$signId;
|
|
$param['con_id']=$conId;
|
|
$param['auto_id']=$autoId;
|
|
$param['tran_id']=$tranId;
|
|
$param['apply_type']=$apply_type;
|
|
$param['flag']=1;
|
|
|
|
Db::name('capitaltask')->insert($param);
|
|
Db::name('capitalbaseinfo')->where(['apply_id'=>$apply_id])->update(['task'=>1]);
|
|
}
|
|
$this->addnotice($apply_id);
|
|
}
|
|
|
|
}else{
|
|
$res['status'] = false;
|
|
$res['msg'] = "审核失败,缺少基本信息";
|
|
}
|
|
return $res;
|
|
}
|
|
private function addnotice($apply_id=''){
|
|
$where=array('apply_id'=>$apply_id);
|
|
$apply = Db::name('capitalapply')->where($where)->find();
|
|
//取得基本信息表
|
|
$baseinfo = Db::name('capitalbaseinfo')->where($where)->find();
|
|
$statuslist=['10'=>'材料初审','20'=>'材料复审','30'=>'专家分配','40'=>'专家审核确认','50'=>'缴费','60'=>'缴费确认','70'=>'联席会审核','80'=>'材料核实','90'=>'公告材料核实','100'=>'待签协议','110'=>'办理入库'];
|
|
|
|
$status=$apply['status'];
|
|
$apply_status=$apply['apply_status'];
|
|
$uid=$apply['user_id'];
|
|
$baseinfo_name=$baseinfo['capital_name'];
|
|
$applytype=$baseinfo['apply_type'];
|
|
$type='艺术';
|
|
if($applytype==1) $type='文化';
|
|
if($applytype==3) $type='古建';
|
|
$notice_title=$type.'资产托管项目【'.$baseinfo_name.'】:';
|
|
if($apply_status==0){
|
|
$process=$this->process[2];
|
|
$index=array_search($status,$process);
|
|
$len=count($process);
|
|
if(($index-1)>=0)$index=$index-1;
|
|
$status=$process[$index];
|
|
}
|
|
$notice_title.=$statuslist[$status];
|
|
|
|
if($apply_status==1){
|
|
if($status==110){
|
|
$notice_title.='(完成入库)';
|
|
}else{
|
|
$notice_title.='(审核通过)';
|
|
}
|
|
}else if($apply_status==2){
|
|
$notice_title.='(审核不通过)';
|
|
}else if($apply_status==3){
|
|
$notice_title.='(可办理入库)';
|
|
}else if($apply_status==0){
|
|
if($status==50){
|
|
$notice_title.='(待缴费)';
|
|
}else if($status==60){
|
|
$notice_title.='(已完成)';
|
|
}else if($status==30){
|
|
$notice_title.='(成功)';
|
|
}else if($status==100){
|
|
$notice_title.=',我们的工作人员会尽快与您联系';
|
|
}else if($status==110){
|
|
if($apply_status==0)$notice_title.='等待办理入库';
|
|
}else{
|
|
$notice_title.='(已通过)';
|
|
}
|
|
}
|
|
if($applytype==1){
|
|
$send=false;
|
|
if($apply_status==2){
|
|
$send=true;
|
|
}
|
|
if($apply_status==1){
|
|
$send=true;
|
|
}
|
|
if($apply_status==0&&in_array($status,[50])){
|
|
$send=true;
|
|
}
|
|
if($send){
|
|
$member=Db::name('member_list')->field('member_list_username,member_list_tel')->where(['member_list_id'=>$uid])->find();
|
|
if($member){
|
|
$mobile=$member['member_list_tel'];
|
|
if(empty($mobile))$mobile=$member['member_list_username'];
|
|
$search = '/^0?1[3|4|5|6|7|8][0-9]\d{8}$/';
|
|
if ( preg_match( $search, $mobile ) ) {
|
|
send_sms($mobile,'您的'.$notice_title);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
$notice='';
|
|
$sl_data=[
|
|
'notice_title'=>$notice_title,
|
|
'notice'=>$notice,
|
|
'user_id'=>$apply['user_id'],
|
|
'apply_id'=>$apply_id,
|
|
'create_id'=>session('admin_auth.aid'),
|
|
'create_type'=>1,
|
|
'create_time'=>time()
|
|
];
|
|
Db::name('capitalnotice')->insert($sl_data);
|
|
}
|
|
/**
|
|
* 专家分配评分
|
|
*/
|
|
public function apply_score()
|
|
{
|
|
$apply_id=input('apply_id');
|
|
$user_id=session('admin_auth.aid');
|
|
$pro_id=input('pro_id');
|
|
$apply_type=input('apply_type');
|
|
$this->assign('apply_type',$apply_type);
|
|
$advice=input('myEditorPro'.$pro_id);
|
|
$jump=url('capital/Capital/apply_check40',array('apply_id'=>$apply_id,'apply_type'=>$apply_type,'snd'=>rand(10000,99999)));
|
|
if($advice=='')$this->error('请输入专家评分意见!',$jump);
|
|
|
|
$score=input('score'.$pro_id);
|
|
if($score<=0)$this->error('请录入评分!',$jump);
|
|
|
|
//更新评分表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('capitalproassign')->where($where)->update($sl_data);
|
|
$this->success('评分成功',$jump);//专家评分确认
|
|
}
|
|
/**
|
|
* 获取多用户名称
|
|
* @param unknown $uids
|
|
* @param unknown $utype
|
|
* @param string $linkStyle
|
|
* @param string $errUserMsg
|
|
* @return string[]|string
|
|
*/
|
|
function get_UserNames($uids,$utype,$linkStyle='|',$errUserMsg='用户不存在'){
|
|
$apply = new Capitalapply();
|
|
$userinfo = $apply->getUserInfos($uids,$utype);
|
|
|
|
$uids=explode(',', $uids);
|
|
|
|
if(count($uids)){
|
|
$data=[];
|
|
foreach ($userinfo as $row){
|
|
$username='';
|
|
if($row){
|
|
$uid=intval($row['member_list_id']);
|
|
if($utype==1){//前台用户
|
|
$username=$row['member_list_username'].' '.$linkStyle.' '.$row['member_list_nickname'];
|
|
}elseif($utype==2){//后台用户
|
|
$username=$row['admin_username'].' '.$linkStyle.' '.$row['admin_realname'];
|
|
}
|
|
$data[$uid]=$username;
|
|
}
|
|
}
|
|
foreach ($uids as $uid){
|
|
if(!isset($data[$uid]))$data[$uid]='未知';
|
|
}
|
|
return $data;
|
|
}
|
|
return $errUserMsg;
|
|
}
|
|
/**
|
|
* 根据用户id获取前后台用户名/用户昵称,返回值为数组
|
|
* @param int $uid 用户id
|
|
* @return string
|
|
*/
|
|
function get_UserStatuses($uids,$utype)
|
|
{
|
|
$apply = new Capitalapply();
|
|
$userinfo = $apply->getUserInfos($uids,$utype);
|
|
|
|
$uids=explode(',', $uids);
|
|
if(count($uids)){
|
|
$data=[];
|
|
foreach ($userinfo as $row){
|
|
$status='';
|
|
if($row){
|
|
$uid=intval($row['member_list_id']);
|
|
if($utype==1){//前台用户
|
|
$status=$row['member_list_open'];
|
|
}elseif($utype==2){//后台用户
|
|
$status=$row['admin_open'];
|
|
}
|
|
$data[$uid]=$status;
|
|
}
|
|
}
|
|
foreach ($uids as $uid){
|
|
if(!isset($data[$uid]))$data[$uid]=[];
|
|
}
|
|
return $data;
|
|
}
|
|
}
|
|
|
|
public function apply_state(){
|
|
$id=input('x');
|
|
if (empty($id))$this->error('用户ID不存在');
|
|
$apply_id=Db::name('capital_upfiles')->where('file_id',$id)->value('apply_id');//查找apply_id
|
|
|
|
if($apply_id){
|
|
$flag=Db::name('capital_upfiles')->where('file_id',$id)->value('flag');//判断当前状态情况
|
|
$state=($flag==1)?0:1;
|
|
$flagdata = array('flag'=>$state);
|
|
Db::name('capital_upfiles')->where('file_id',$id)->setField($flagdata);
|
|
$msg=($flag==1)?'审核未通过':'审核已通过';
|
|
$this->success($msg);
|
|
}
|
|
|
|
}
|
|
public function apply_state2(){
|
|
$id=input('x');
|
|
if (empty($id))$this->error('用户ID不存在');
|
|
$apply_id=Db::name('capitaldetail')->where('id',$id)->value('apply_id');//查找apply_id
|
|
|
|
if($apply_id){
|
|
$flag=Db::name('capitaldetail')->where('id',$id)->value('flag');//判断当前状态情况
|
|
$state=($flag==1)?0:1;
|
|
$flagdata = array('flag'=>$state,'flag_time'=>time());
|
|
Db::name('capitaldetail')->where('id',$id)->setField($flagdata);
|
|
$msg=($flag==1)?'审核未通过':'审核已通过';
|
|
$this->success($msg);
|
|
}
|
|
|
|
}
|
|
public function owner_state(){
|
|
$id=input('x');
|
|
if (empty($id))$this->error('用户ID不存在');
|
|
$apply_id=Db::name('capitaldetail')->where('id',$id)->value('apply_id');//查找apply_id
|
|
|
|
if($apply_id){
|
|
$flag=Db::name('capitaldetail')->where('id',$id)->value('owner_state');//判断当前状态情况
|
|
$state=($flag==1)?0:1;
|
|
$flagdata = array('owner_state'=>$state);
|
|
Db::name('capitaldetail')->where('id',$id)->setField($flagdata);
|
|
$msg=($flag==1)?'审核未通过':'审核已通过';
|
|
$this->success($msg);
|
|
}
|
|
|
|
}
|
|
public function apply_upfiles(){
|
|
$id=input('id');
|
|
if (empty($id))$this->error('用户ID不存在');
|
|
$files=Db::name('capital_upfiles')->where('apply_id',$id)->select();//查找apply_id
|
|
foreach ($files as $row){
|
|
if($row['flag'] == 0){
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
|
|
}
|
|
public function apply_product(){
|
|
$id=input('id');
|
|
$atype=input('apply_type');
|
|
if (empty($id))$this->error('用户ID不存在');
|
|
$files=Db::name('capitaldetail')->where('apply_id',$id)->select();//查找apply_id
|
|
foreach ($files as $row){
|
|
if($row['flag'] == 0||($atype==3&&$row['capital_owner']&&$row['owner_state'] == 0)){
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
|
|
}
|
|
/**
|
|
* 文化四板固定文件类型修改
|
|
*/
|
|
public function uptype_edit(){
|
|
if(!request()->isAjax()) {
|
|
//创建token
|
|
creatToken();
|
|
|
|
$apply_type=input('apply_type');
|
|
$this->assign('apply_type',$apply_type);
|
|
$ftype_id = input('ftype_id', 0, 'intval');
|
|
if (!$ftype_id) $this->error('参数错误', url('capital/Capital/uptype_list',array('apply_type'=>$apply_type)));
|
|
$uptype = Db::name('capitaluptype')->where('ftype_id', $ftype_id)->find();
|
|
$this->assign('uptype', $uptype);
|
|
$where['status'] = array('egt',0);
|
|
$statuslist=Db::name('capitalstatus')->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'))) {
|
|
//$this->error("请勿重复提交");
|
|
}
|
|
|
|
//固定
|
|
$apply_id = 0;
|
|
$apply_type=input('apply_type');
|
|
$mustupload=input('mustupload');
|
|
$status=input('status');
|
|
$mobile=input('mobile');
|
|
$userid=session('admin_auth.aid');
|
|
//上传模板部分
|
|
$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'] = $userid;
|
|
$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('capital_upfiles')->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('capital_upfiles')->where('file_id',$file_id)->update($data);
|
|
}
|
|
$sl_data=array(
|
|
'ftype_id'=>input('ftype_id'),
|
|
'ftypedescr'=>input('ftypedescr'),
|
|
'ftemp_id' => $file_id,
|
|
'apply_type' => $apply_type,
|
|
'mustupload' => $mustupload,
|
|
'ftype'=>input('ftype'),
|
|
'status'=>$status,
|
|
'mobile'=>$mobile,
|
|
'isopen'=>input('isopen',0),
|
|
'apply_id'=>$apply_id,
|
|
'user_id'=>$userid,
|
|
'create_time'=>time(),
|
|
'upload_role_type'=>$roletype,
|
|
'upload_role_id'=>$roleid,
|
|
'upload_role_type2'=>$roletype2,
|
|
'upload_role_id2'=>$roleid2,
|
|
'forder'=>input('forder',0)
|
|
);
|
|
$uptype_id=Db::name('capitaluptype')->where('ftype_id',input('ftype_id'))->update($sl_data);
|
|
if($uptype_id){
|
|
$this->success('文件类型修改成功',url('capital/Capital/uptype_list',array('apply_type'=>$apply_type)));
|
|
}else{
|
|
$this->error('文件类型修改失败');
|
|
}
|
|
}
|
|
}
|
|
/**
|
|
* 文化四板文件类型添加操作
|
|
*/
|
|
public function uptype_runadd(){
|
|
$apply_id=input('apply_id');
|
|
$apply_type=input('apply_type');
|
|
$this->assign('apply_type',$apply_type);
|
|
$ftypedescr=input('ftypedescr');
|
|
$mustupload=input('mustupload');
|
|
$forder=input('forder');
|
|
$roletype=input('roletype');
|
|
$roleid=input('roletitle');
|
|
$roletype2=input('roletype2');
|
|
$roleid2=input('roletitle2');
|
|
$status=input('status');
|
|
$isopen=input('isopen','0');
|
|
$ftype=input('ftype');
|
|
$apply_type=input("apply_type");
|
|
$user_id='';
|
|
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;
|
|
}
|
|
|
|
//上传模板部分
|
|
$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('capital_upfiles')->insert($data,false,true);
|
|
|
|
} else {
|
|
$this->error($file->getError());//否则就是上传错误,显示错误原因
|
|
}
|
|
}
|
|
|
|
$sldata=array(
|
|
'ftypedescr'=>$ftypedescr,
|
|
'ftemp_id' => $file_id,
|
|
'apply_type' => $apply_type,
|
|
'mustupload' => $mustupload,
|
|
'apply_id'=>$apply_id,
|
|
'ftype'=>$ftype,
|
|
'status'=>$status,
|
|
'isopen'=>$isopen,
|
|
'user_id'=>$user_id,
|
|
'create_time'=>time(),
|
|
'upload_role_type'=>$roletype,
|
|
'upload_role_id'=>$roleid,
|
|
'upload_role_type2'=>$roletype2,
|
|
'upload_role_id2'=>$roleid2,
|
|
'forder'=>$forder,
|
|
);
|
|
|
|
$uptype_id=UptypeModel::add($sldata);
|
|
if($uptype_id){
|
|
$this->success('文件类型添加成功',url('capital/Capital/uptype_list',array('apply_type'=>$apply_type)));
|
|
}else{
|
|
$this->error('文件类型添加失败');
|
|
}
|
|
}
|
|
/**
|
|
* 调用显示某个状态下文化四板文件类型列表
|
|
* @param int $ftype 查询条件(-1:包括临时和固定 1:固定 2:临时)
|
|
* @param int $status 后台查询的操作用户状态
|
|
* @return 对应文件类型列表
|
|
*/
|
|
public function uptype_list($process=-1,$status=-1,$ftype=1){
|
|
|
|
//固定类型input('apply_id')==null
|
|
$apply_type=input("apply_type",-1);
|
|
$uptype_list=UptypeModel::getList($apply_type,0,$ftype,$status,-1,'forder desc,ftype_id desc',-1);
|
|
|
|
$page = $uptype_list->render();
|
|
$this->assign('uptype_list',$uptype_list);
|
|
$this->assign('page',$page);
|
|
|
|
return $this->fetch();
|
|
}
|
|
/**
|
|
* 调用显示某个状态下文化四板文件类型列表
|
|
* @param int $ftype 查询条件(-1:包括临时和固定 1:固定 2:临时)
|
|
* @param int $status 后台查询的操作用户状态
|
|
* @return 对应文件类型列表
|
|
*/
|
|
public function notice_list(){
|
|
$apply_type=input("apply_type",-1);
|
|
$search_name=input("search_name",'');
|
|
$where=['a.create_type'=>0,'b.apply_type'=>$apply_type];
|
|
if($search_name){
|
|
$where['a.notice_title']=array('like','%'.$search_name.'%');
|
|
}
|
|
$lists=Db::name('capitalnotice')->alias('a')
|
|
->where($where)
|
|
->order('a.create_time desc')
|
|
->field('a.*,b.apply_type')
|
|
->join(config('database.prefix')."capitalbaseinfo b"," a.apply_id = b.apply_id")
|
|
->paginate(config('paginate.list_rows'),false,['query'=>request()->param()]);
|
|
$page = $lists->render();
|
|
$this->assign('notice_list',$lists);
|
|
$this->assign('page',$page);
|
|
$this->assign('search_name',$search_name);
|
|
|
|
return $this->fetch();
|
|
}
|
|
/**
|
|
* 文化四板文件类型添加
|
|
*/
|
|
public function uptype_add($process=-1,$status=-1){
|
|
$apply_id=input('apply_id');
|
|
$apply_type=input('apply_type');
|
|
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();
|
|
$this->assign('apply_id',$apply_id);
|
|
$this->assign('apply_type',$apply_type);
|
|
$this->assign('status',$status);
|
|
$where['status'] = array('egt',0);
|
|
$statuslist=Db::name('capitalstatus')->where($where)->select();
|
|
$this->assign('statuslist',$statuslist);
|
|
|
|
return $this->fetch();
|
|
}
|
|
|
|
/**
|
|
* 文化四板文件类型列表开启/禁止
|
|
*/
|
|
public function uptype_state($process=-1,$status=-1){
|
|
|
|
$apply_type=input("apply_type");
|
|
$id=input('x');
|
|
//取得apply_id
|
|
$apply_id=get_capitalApplyIDFromTempID($id);
|
|
$maps=[1=>[1,19],2=>[2,36],3=>[5,20],4=>[6,21],6=>[12,39],8=>[15,14,23],9=>[16,4,8,11,13,17,28,34],10=>[25,46,47],11=>[48,27,29],12=>[51,30]];
|
|
$current=isset($maps[$process])?$maps[$process]:[];
|
|
if(count($current)){
|
|
$status=Db::name('capitalapply')->where('apply_id',$apply_id)->value('status');//判断当前状态情况
|
|
if(!in_array($status,$current))$status=array_shift($current);
|
|
}
|
|
if (empty($id)){
|
|
//如果不是固定添加类型
|
|
$jump=!($process == -1 or $status ==-1)?url('capital/Capital/uptype_list' . $process,array('apply_type'=>$apply_type)):url('capital/Capital/uptype_list',array('apply_type'=>$apply_type));
|
|
$this->error('文件ID不存在',$jump);
|
|
}
|
|
if($apply_id==-1){
|
|
$this->error('无权限',url('admin/Index/index'));
|
|
}
|
|
|
|
//如果不是固定添加类型
|
|
if (!($process == -1 or $status ==-1 or $apply_id==0)) {
|
|
//权限检查
|
|
if (check_capitalUserRight($apply_id, session('admin_auth.aid'), $status) == 0) {
|
|
$this->error('无权限',url('admin/Index/index'));
|
|
}
|
|
}
|
|
|
|
$isopen=Db::name('capitaluptype')->where('ftype_id',$id)->value('isopen');//判断当前状态情况
|
|
$open=($isopen==1)?0:1;
|
|
$statedata = array('isopen'=>$open);
|
|
Db::name('capitaluptype')->where('ftype_id',$id)->setField($statedata);
|
|
$msg=($isopen==1)?'状态禁止':'状态开启';
|
|
$this->success($msg);
|
|
}
|
|
}
|
|
|