where('code','orgagree_options')->field('id,name,create_time')->select(); $this->assign('list',$agree_list); return $this->fetch(); } /** * 合作机构申请同意协议模板设置显示 */ public function orgagree() { $sys=self::get('orgagree_options'); $this->assign('sys',$sys); return $this->fetch(); } /** * 合作机构申请同意协议模板设置保存 */ public function orgagreerun() { if (!request()->isAjax()){ $this->error('提交方式不正确'); }else{ $options=input('post.options/a'); $options['content_tpl']=htmlspecialchars_decode($options['content_tpl']); $options['code']='orgagree_options'; $options['id']=input('id'); $rst=self::update($options); if($rst!==false){ $this->success('合作机构申请同意协议模板设置保存成功',url('org/Orgsetup/orgagree_list')); }else{ $this->error('提交参数不正确'); } } } /** * 合作机构申请缴费通知模板列表 */ public function orgfee_list() { $fee_list=Db::name('org_temp')->where('code','orgfee_options')->field('id,name,create_time')->select(); $this->assign('list',$fee_list); return $this->fetch(); } /** * 合作机构申请缴费通知模板设置显示 */ public function orgfee() { $sys=self::get('orgfee_options',input('id')); $this->assign('sys',$sys); return $this->fetch(); } /** * 合作机构申请缴费通知模板设置保存 */ public function orgfeerun() { if (!request()->isAjax()){ $this->error('提交方式不正确'); }else{ $options=input('post.options/a'); $id = input('id'); $options['content_tpl']=htmlspecialchars_decode($options['content_tpl']); $options['code']='orgfee_options'; $options['id']=$id; $rst=self::update($options); if($rst!==false){ $this->success('合作机构申请缴费通知模板设置保存成功',url('org/Orgsetup/orgfee_list')); }else{ $this->error('提交参数不正确'); } } } /** * 合作机构申请初审意见书模板设置显示 */ public function orgcheck() { $sys=self::get('orgcheck_options',-1); $this->assign('sys',$sys); return $this->fetch(); } /** * 合作机构申请初审意见书模板设置保存 */ public function orgcheckrun() { if (!request()->isAjax()){ $this->error('提交方式不正确',url('org/Orgsetup/orgcheck')); }else{ $options=input('post.options/a'); $options['content_tpl']=htmlspecialchars_decode($options['content_tpl']); $options['code']='orgcheck_options'; $rst=self::update($options); if($rst!==false){ $this->success('合作机构申请初审意见书模板设置保存成功',url('org/Orgsetup/orgcheck')); }else{ $this->error('提交参数不正确',url('org/Orgsetup/orgcheck')); } } } /** * 合作机构申请公告模板设置显示 */ public function orggg() { $sys=self::get('orggg_options',-1); $this->assign('sys',$sys); return $this->fetch(); } /** * 合作机构申请公告模板设置保存 */ public function orgggrun() { if (!request()->isAjax()){ $this->error('提交方式不正确',url('org/Orgsetup/orggg')); }else{ $options=input('post.options/a'); $options['content_tpl']=htmlspecialchars_decode($options['content_tpl']); $options['code']='orggg_options'; $rst=self::update($options); if($rst!==false){ $this->success('合作机构申请公告模板设置保存成功',url('org/Orgsetup/orggg')); }else{ $this->error('提交参数不正确',url('org/Orgsetup/orggg')); } } } /** * 合作机构申请成功通知公告模板设置显示 */ public function orgsuccess() { $sys=self::get('orgsuccess_options',-1); $this->assign('sys',$sys); return $this->fetch(); } /** * 合作机构申请成功通知公告模板设置保存 */ public function orgsuccessrun() { if (!request()->isAjax()){ $this->error('提交方式不正确',url('org/Orgsetup/orgsuccess')); }else{ $options=input('post.options/a'); $options['content_tpl']=htmlspecialchars_decode($options['content_tpl']); $options['code']='orgsuccess_options'; $rst=self::update($options); if($rst!==false){ $this->success('合作机构申请成功通知公告模板设置保存成功',url('org/Orgsetup/orgsuccess')); }else{ $this->error('提交参数不正确',url('org/Orgsetup/orgsuccess')); } } } /** * 合作机构申请牌匾模板设置显示 */ public function orgplaque() { $sys=self::get('orgplaque_options',-1); $this->assign('sys',$sys); return $this->fetch(); } /** * 合作机构申请牌匾模板设置保存 */ public function orgplaquerun() { if (!request()->isAjax()){ $this->error('提交方式不正确',url('org/Orgsetup/orgplaque')); }else{ $options=input('post.options/a'); $options['content_tpl']=htmlspecialchars_decode($options['content_tpl']); $options['code']='orgplaque_options'; $rst=self::update($options); if($rst!==false){ $this->success('合作机构申请成功通知公告模板设置保存成功',url('org/Orgsetup/orgplaque')); }else{ $this->error('提交参数不正确',url('org/Orgsetup/orgplaque')); } } } /** * 合作机构模板设置显示 */ public function orginfo() { $sys=self::get('orginfo_options',-1); $this->assign('sys',$sys); return $this->fetch(); } /** * 合作机构模板设置保存 */ public function orginforun() { if (!request()->isAjax()){ $this->error('提交方式不正确',url('org/Orgsetup/orginfo')); }else{ $options=input('post.options/a'); $options['content_tpl']=htmlspecialchars_decode($options['content_tpl']); $options['code']='orginfo_options'; $rst=self::update($options); if($rst!==false){ $this->success('合作机构申请成功通知公告模板设置保存成功',url('org/Orgsetup/orginfo')); }else{ $this->error('提交参数不正确',url('org/Orgsetup/orginfo')); } } } /** * 授权书模板设置 */ public function orgsq() { $sys=self::get('orgsq_options',-1); $this->assign('sys',$sys); return $this->fetch(); } /** * 授权书模板设置保存 */ public function orgsqrun() { if (!request()->isAjax()){ $this->error('提交方式不正确',url('org/Orgsetup/orgsq')); }else{ $options=input('post.options/a'); $options['content_tpl']=htmlspecialchars_decode($options['content_tpl']); $options['code']='orgsq_options'; $rst=self::update($options); if($rst!==false){ $this->success('授权书模板设置保存成功',url('org/Orgsetup/orgsq')); }else{ $this->error('提交参数不正确',url('org/Orgsetup/orgsq')); } } } public static function get($type_code=-1,$id=-1){ if($type_code!=-1 && $id!=-1){ $temp = cache($type_code.'_'.$id); if(empty($temp)){ $where['code']=$type_code; $where['id']=$id; $temp = Db::name('org_temp')->where($where)->find(); cache($type_code.'_'.$id,$temp); } }elseif ($type_code!=-1){ $temp = cache($type_code.'_'); if(empty($temp)){ $where['code']=$type_code; $temp = Db::name('org_temp')->where($where)->find(); cache($type_code.'_',$temp); } } return $temp; } public static function update($setup){ $setup['create_time']=time(); $setup['create_id']=session('admin_auth.aid'); if(!empty($setup)){ if(empty($setup['id'])){ $where['code']=$setup['code']; $rst = Db::name('org_temp')->where($where)->update($setup); if($rst){ cache($setup['code'].'_',$setup); } }else{ $where['code']=$setup['code']; $where['id']=$setup['id']; $rst = Db::name('org_temp')->where($where)->update($setup); if($rst){ cache($setup['code'].'_'.$setup['id'],$setup); } } return $rst; } } }