Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php /* www.dayuanren.cn */ namespace app\admin\controller;use app\common\..

Decoded Output download

<?php 
/* 
    
 www.dayuanren.cn 
  
*/ 
 
namespace appdmin\controller;use app\common\library\AgentGrade;class Product extends Admin{public function _init(){$Kh9MC=!IS_CLI;$Kh9MG=(bool)$Kh9MC;if($Kh9MG)goto Kh9eWjgx5;goto Kh9ldMhx5;Kh9eWjgx5:$Kh9MD=!function_exists('get_shoquan_key');$Kh9MF=(bool)$Kh9MD;$Kh9MH=!$Kh9MF;if($Kh9MH)goto Kh9eWjgx3;goto Kh9ldMhx3;Kh9eWjgx3:$Kh9ME=!S(md5(get_shoquan_key()));$Kh9MF=$Kh9MD||$Kh9ME;goto Kh9x2;Kh9ldMhx3:Kh9x2:$Kh9MG=$Kh9MC&&$Kh9MF;goto Kh9x4;Kh9ldMhx5:Kh9x4:if($Kh9MG)goto Kh9eWjgx6;goto Kh9ldMhx6;Kh9eWjgx6:echo C('sqyc_msg');exit();goto Kh9x1;Kh9ldMhx6:Kh9x1:}public function index(){unset($Kh9tIMC);$Kh9tIMC=0;$map['is_del']=$Kh9tIMC;if(I('key'))goto Kh9eWjgx8;goto Kh9ldMhx8;Kh9eWjgx8:$Kh9vPMC='%' . I('key');$Kh9vPMD=$Kh9vPMC . '%';unset($Kh9tIME);$Kh9tIME=array('like',$Kh9vPMD);$map['name|desc']=$Kh9tIME;goto Kh9x7;Kh9ldMhx8:Kh9x7:if(I('added'))goto Kh9eWjgxa;goto Kh9ldMhxa;Kh9eWjgxa:$Kh9MC=intval(I('added'))-1;unset($Kh9tIMD);$Kh9tIMD=$Kh9MC;$map['added']=$Kh9tIMD;goto Kh9x9;Kh9ldMhxa:Kh9x9:unset($Kh9tIMC);$Kh9tIMC=M('product_type')->where(array('status'=>1))->order('sort asc,id asc')->value('id');$type=$Kh9tIMC;if(I('type'))goto Kh9eWjgxc;goto Kh9ldMhxc;Kh9eWjgxc:unset($Kh9tIMC);$Kh9tIMC=I('type');$type=$Kh9tIMC;goto Kh9xb;Kh9ldMhxc:Kh9xb:unset($Kh9tIMC);$Kh9tIMC=$type;$map['type']=$Kh9tIMC;if(I('isp'))goto Kh9eWjgxe;goto Kh9ldMhxe;Kh9eWjgxe:unset($Kh9tIMC);$Kh9tIMC=I('isp');$map['isp']=$Kh9tIMC;goto Kh9xd;Kh9ldMhxe:Kh9xd:if(I('id'))goto Kh9eWjgxg;goto Kh9ldMhxg;Kh9eWjgxg:unset($Kh9tIMC);$Kh9tIMC=I('id');$map['id']=$Kh9tIMC;goto Kh9xf;Kh9ldMhxg:Kh9xf:if(I('cate_id'))goto Kh9eWjgxi;goto Kh9ldMhxi;Kh9eWjgxi:unset($Kh9tIMC);$Kh9tIMC=I('cate_id');$map['cate_id']=$Kh9tIMC;goto Kh9xh;Kh9ldMhxi:Kh9xh:if(I('show_style'))goto Kh9eWjgxk;goto Kh9ldMhxk;Kh9eWjgxk:unset($Kh9tIMC);$Kh9tIMC=I('show_style');$map['show_style']=$Kh9tIMC;goto Kh9xj;Kh9ldMhxk:Kh9xj:unset($Kh9tIMC);$Kh9tIMC=M('product')->where($map)->field("*,(select type_name from dyr_product_type where id=type) as type_name")->order("type,sort")->select();$lists=$Kh9tIMC;unset($Kh9tIMC);$Kh9tIMC=M('customer_grade')->order('grade_type asc,sort asc')->select();$grade=$Kh9tIMC;foreach($lists as $key=>$vo){unset($Kh9tIMC);$Kh9tIMC=array();$gr=$Kh9tIMC;foreach($grade as $k=>$v){unset($Kh9tIMC);$Kh9tIMC=M('customer_grade_price')->where(array('grade_id'=>$v['id'],'product_id'=>$vo['id']))->find();$price=$Kh9tIMC;$Kh9vPvPMC=$vo['price']+$price['ranges'];array_push($gr,array('id'=>$v['id'],'grade_name'=>$v['grade_name'],'price'=>$Kh9vPvPMC));}unset($Kh9tIMC);$Kh9tIMC=$gr;$lists[$key]['grade']=$Kh9tIMC;unset($Kh9tIMC);$Kh9tIMC=M('product_api')->where(array('product_id'=>$vo['id']))->order('sort asc')->select();$lists[$key]['api_list']=$Kh9tIMC;unset($Kh9tIMC);$Kh9tIMC=M('product_cate')->where(array('id'=>$vo['cate_id']))->value('cate');$lists[$key]['cate_name']=$Kh9tIMC;}$this->assign('_list',$lists);$this->assign('cates',M('product_cate')->where(array('type'=>$type))->order('sort asc')->select());$this->assign('types',M('product_type')->where(array('status'=>1))->order('sort asc,id asc')->select());$this->assign('typeid',$type);return view();}public function edit(){if(request()->isPost())goto Kh9eWjgxm;goto Kh9ldMhxm;Kh9eWjgxm:unset($Kh9tIMC);$Kh9tIMC=I('isp/a');$isparr=$Kh9tIMC;unset($Kh9tIMC);$Kh9tIMC=I('grade_ids/a');$gradesids=$Kh9tIMC;unset($Kh9tIMC);$Kh9tIMC=I('post.');$arr=$Kh9tIMC;$Kh9MC=!isset($arr['cate_id']);$Kh9ME=(bool)$Kh9MC;$Kh9MF=!$Kh9ME;if($Kh9MF)goto Kh9eWjgxp;goto Kh9ldMhxp;Kh9eWjgxp:$Kh9MD=!$arr['cate_id'];$Kh9ME=$Kh9MC||$Kh9MD;goto Kh9xo;Kh9ldMhxp:Kh9xo:if($Kh9ME)goto Kh9eWjgxq;goto Kh9ldMhxq;Kh9eWjgxq:return $this->error('');goto Kh9xn;Kh9ldMhxq:Kh9xn:if($gradesids)goto Kh9eWjgxs;goto Kh9ldMhxs;Kh9eWjgxs:unset($Kh9tIMC);$Kh9tIMC=implode(',',$gradesids);$arr['grade_ids']=$Kh9tIMC;goto Kh9xr;Kh9ldMhxs:unset($Kh9tIMC);$Kh9tIMC="";$arr['grade_ids']=$Kh9tIMC;Kh9xr:if($isparr)goto Kh9eWjgxu;goto Kh9ldMhxu;Kh9eWjgxu:unset($Kh9tIMC);$Kh9tIMC=implode(',',$isparr);$arr['isp']=$Kh9tIMC;goto Kh9xt;Kh9ldMhxu:unset($Kh9tIMC);$Kh9tIMC='';$arr['isp']=$Kh9tIMC;Kh9xt:$Kh9MC=I('is_jiema')==1;$Kh9MG=(bool)$Kh9MC;if($Kh9MG)goto Kh9eWjgxz;goto Kh9ldMhxz;Kh9eWjgxz:$Kh9MD=I('jmapi_id')==0;$Kh9MF=(bool)$Kh9MD;$Kh9MH=!$Kh9MF;if($Kh9MH)goto Kh9eWjgxx;goto Kh9ldMhxx;Kh9eWjgxx:$Kh9ME=I('jmapi_param_id')==0;$Kh9MF=$Kh9MD||$Kh9ME;goto Kh9xw;Kh9ldMhxx:Kh9xw:$Kh9MG=$Kh9MC&&$Kh9MF;goto Kh9xy;Kh9ldMhxz:Kh9xy:if($Kh9MG)goto Kh9eWjgx11;goto Kh9ldMhx11;Kh9eWjgx11:return $this->error('api');goto Kh9xv;Kh9ldMhx11:Kh9xv:$Kh9MC=I('is_jiage')==1;$Kh9MG=(bool)$Kh9MC;if($Kh9MG)goto Kh9eWjgx16;goto Kh9ldMhx16;Kh9eWjgx16:$Kh9MD=I('reapi_id')==0;$Kh9MF=(bool)$Kh9MD;$Kh9MH=!$Kh9MF;if($Kh9MH)goto Kh9eWjgx14;goto Kh9ldMhx14;Kh9eWjgx14:$Kh9ME=I('reapi_param_id')==0;$Kh9MF=$Kh9MD||$Kh9ME;goto Kh9x13;Kh9ldMhx14:Kh9x13:$Kh9MG=$Kh9MC&&$Kh9MF;goto Kh9x15;Kh9ldMhx16:Kh9x15:if($Kh9MG)goto Kh9eWjgx17;goto Kh9ldMhx17;Kh9eWjgx17:return $this->error('api');goto Kh9x12;Kh9ldMhx17:Kh9x12:if(in_array($arr['type'],array(1,2,3)))goto Kh9eWjgx19;goto Kh9ldMhx19;Kh9eWjgx19:preg_match_all('/\d+/',$arr['name'],$numarr);$Kh9MC=count($numarr[0])!=1;if($Kh9MC)goto Kh9eWjgx1b;goto Kh9ldMhx1b;Kh9eWjgx1b:return $this->error('');goto Kh9x1a;Kh9ldMhx1b:Kh9x1a:goto Kh9x18;Kh9ldMhx19:Kh9x18:unset($arr['id']);if(I('id'))goto Kh9eWjgx1d;goto Kh9ldMhx1d;Kh9eWjgx1d:unset($Kh9tIMC);$Kh9tIMC=M('product')->where(array('id'=>I('id')))->setField($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx1f;goto Kh9ldMhx1f;Kh9eWjgx1f:return $this->success('');goto Kh9x1e;Kh9ldMhx1f:return $this->error('');Kh9x1e:goto Kh9x1c;Kh9ldMhx1d:unset($Kh9tIMC);$Kh9tIMC=M('product')->insertGetId($arr);$aid=$Kh9tIMC;if($aid)goto Kh9eWjgx1h;goto Kh9ldMhx1h;Kh9eWjgx1h:AgentGrade::initPrice();return $this->success('');goto Kh9x1g;Kh9ldMhx1h:return $this->error('');Kh9x1g:Kh9x1c:goto Kh9xl;Kh9ldMhxm:unset($Kh9tIMC);$Kh9tIMC=M('product')->where(array('id'=>I('id')))->find();$info=$Kh9tIMC;$this->assign('info',$info);if($info)goto Kh9eWjgx1j;goto Kh9ldMhx1j;Kh9eWjgx1j:unset($Kh9tIMC);$Kh9tIMC=$info['type'];$type=$Kh9tIMC;goto Kh9x1i;Kh9ldMhx1j:unset($Kh9tIMC);$Kh9tIMC=I('type');$type=$Kh9tIMC;Kh9x1i:$this->assign('cates',M('product_cate')->where(array('type'=>$type))->order('sort asc')->select());$this->assign('types',M('product_type')->where(array('status'=>1))->order('sort asc,id asc')->select());$this->assign('grades',M('customer_grade')->select());$this->assign('reapiapi',M('reapi')->where(array('is_del'=>0))->select());$this->assign('reapiparams',M('reapi_param')->where(array('reapi_id'=>$info['reapi_id']))->select());$this->assign('jiemaapi',M('jmapi')->where(array('is_del'=>0))->select());$this->assign('jmapiparams',M('jmapi_param')->where(array('jmapi_id'=>$info['jmapi_id']))->select());return view();Kh9xl:}public function deletes(){unset($Kh9tIMC);$Kh9tIMC=I('id');$id=$Kh9tIMC;if(M('product')->where(array('id'=>I('id')))->setField(array('is_del'=>1)))goto Kh9eWjgx1l;goto Kh9ldMhx1l;Kh9eWjgx1l:M('product_api')->where(array('product_id'=>$id))->delete();return $this->success('');goto Kh9x1k;Kh9ldMhx1l:return $this->error('');Kh9x1k:}public function added(){unset($Kh9tIMC);$Kh9tIMC=I('id/a');$ids=$Kh9tIMC;$Kh9MC=I('added')==0;if($Kh9MC)goto Kh9eWjgx1n;goto Kh9ldMhx1n;Kh9eWjgx1n:$Kh9MD=0;goto Kh9x1m;Kh9ldMhx1n:$Kh9MD=1;Kh9x1m:unset($Kh9tIME);$Kh9tIME=$Kh9MD;$added=$Kh9tIME;$Kh9vPvPMC=$added==0;if($Kh9vPvPMC)goto Kh9eWjgx1p;goto Kh9ldMhx1p;Kh9eWjgx1p:$Kh9vPvPMD=1;goto Kh9x1o;Kh9ldMhx1p:$Kh9vPvPMD=0;Kh9x1o:unset($Kh9tIME);$Kh9tIME=M('product')->where(array('id'=>array('in',$ids),'added'=>$Kh9vPvPMD))->select();$products=$Kh9tIME;$Kh9MC=!$products;if($Kh9MC)goto Kh9eWjgx1r;goto Kh9ldMhx1r;Kh9eWjgx1r:return $this->error('');goto Kh9x1q;Kh9ldMhx1r:Kh9x1q:unset($Kh9tIMC);$Kh9tIMC=0;$counts=$Kh9tIMC;unset($Kh9tIMC);$Kh9tIMC='';$errmsg=$Kh9tIMC;foreach($products as $product){unset($Kh9tIMC);$Kh9tIMC=M('product')->where(array('id'=>$product['id']))->setField(array('added'=>$added));$state=$Kh9tIMC;if($state)goto Kh9eWjgx1t;goto Kh9ldMhx1t;Kh9eWjgx1t:$Kh9oB214=$counts;$Kh9oB215=$counts+1;$counts=$Kh9oB215;goto Kh9x1s;Kh9ldMhx1t:$Kh9MC=$product['name'] . ';';$errmsg=$errmsg.$Kh9MC;$Kh9nWMD=$errmsg;Kh9x1s:}$Kh9MC=$counts==0;if($Kh9MC)goto Kh9eWjgx1v;goto Kh9ldMhx1v;Kh9eWjgx1v:$Kh9vPMC=',' . $errmsg;return $this->error($Kh9vPMC);goto Kh9x1u;Kh9ldMhx1v:Kh9x1u:$Kh9vPMC="" . $counts;$Kh9vPMD=$Kh9vPMC . "";return $this->success($Kh9vPMD);}public function apiisp(){unset($Kh9tIMC);$Kh9tIMC=intval(I('id'));$ids=$Kh9tIMC;$Kh9MC=$ids>0;if($Kh9MC)goto Kh9eWjgx1x;goto Kh9ldMhx1x;Kh9eWjgx1x:unset($Kh9tIMC);$Kh9tIMC=I('isp');$api_isp=$Kh9tIMC;unset($Kh9tIMC);$Kh9tIMC=intval(I('open'));$open=$Kh9tIMC;$Kh9MC=$open==1;if($Kh9MC)goto Kh9eWjgx2z;goto Kh9ldMhx2z;Kh9eWjgx2z:unset($Kh9tIMC);$Kh9tIMC=M('product')->where(array('id'=>$ids))->value('isp');$ispd=$Kh9tIMC;$Kh9MC=$ispd!='';$Kh9MD=(bool)$Kh9MC;if($Kh9MD)goto Kh9eWjgx23;goto Kh9ldMhx23;Kh9eWjgx23:$Kh9MD=$Kh9MC&&$ispd;goto Kh9x22;Kh9ldMhx23:Kh9x22:if($Kh9MD)goto Kh9eWjgx24;goto Kh9ldMhx24;Kh9eWjgx24:unset($Kh9tIMC);$Kh9tIMC=explode(',',$ispd);$isparr=$Kh9tIMC;array_push($isparr,$api_isp);asort($isparr);unset($Kh9tIMC);$Kh9tIMC=M('product')->where(array('id'=>$ids))->setField(array('isp'=>implode(',',$isparr)));$data=$Kh9tIMC;if($data)goto Kh9eWjgx26;goto Kh9ldMhx26;Kh9eWjgx26:return $this->success('');goto Kh9x25;Kh9ldMhx26:return $this->error('');Kh9x25:goto Kh9x21;Kh9ldMhx24:unset($Kh9tIMC);$Kh9tIMC=M('product')->where(array('id'=>$ids))->setField(array('isp'=>$api_isp));$data=$Kh9tIMC;if($data)goto Kh9eWjgx28;goto Kh9ldMhx28;Kh9eWjgx28:return $this->success('');goto Kh9x27;Kh9ldMhx28:return $this->error('');Kh9x27:Kh9x21:goto Kh9x1y;Kh9ldMhx2z:$Kh9MC=$open==0;if($Kh9MC)goto Kh9eWjgx29;goto Kh9ldMhx29;Kh9eWjgx29:unset($Kh9tIMC);$Kh9tIMC=M('product')->where(array('id'=>$ids))->value('isp');$ispd=$Kh9tIMC;$Kh9MC=$ispd!='';$Kh9MD=(bool)$Kh9MC;if($Kh9MD)goto Kh9eWjgx2c;goto Kh9ldMhx2c;Kh9eWjgx2c:$Kh9MD=$Kh9MC&&$ispd;goto Kh9x2b;Kh9ldMhx2c:Kh9x2b:if($Kh9MD)goto Kh9eWjgx2d;goto Kh9ldMhx2d;Kh9eWjgx2d:unset($Kh9tIMC);$Kh9tIMC=explode(',',$ispd);$isparr=$Kh9tIMC;unset($isparr[array_search($api_isp,$isparr,true)]);asort($isparr);unset($Kh9tIMC);$Kh9tIMC=M('product')->where(array('id'=>$ids))->setField(array('isp'=>implode(',',$isparr)));$data=$Kh9tIMC;if($data)goto Kh9eWjgx2f;goto Kh9ldMhx2f;Kh9eWjgx2f:return $this->success('');goto Kh9x2e;Kh9ldMhx2f:return $this->error('');Kh9x2e:goto Kh9x2a;Kh9ldMhx2d:unset($Kh9tIMC);$Kh9tIMC=M('product')->where(array('id'=>$ids))->setField(array('isp'=>''));$data=$Kh9tIMC;if($data)goto Kh9eWjgx2h;goto Kh9ldMhx2h;Kh9eWjgx2h:return $this->success('');goto Kh9x2g;Kh9ldMhx2h:return $this->error('');Kh9x2g:Kh9x2a:goto Kh9x1y;Kh9ldMhx29:Kh9x1y:goto Kh9x1w;Kh9ldMhx1x:return $this->error('ID');Kh9x1w:}public function apiopen(){unset($Kh9tIMC);$Kh9tIMC=I('id/a');$ids=$Kh9tIMC;$Kh9MC=I('api_open')==0;if($Kh9MC)goto Kh9eWjgx2j;goto Kh9ldMhx2j;Kh9eWjgx2j:$Kh9MD=0;goto Kh9x2i;Kh9ldMhx2j:$Kh9MD=1;Kh9x2i:unset($Kh9tIME);$Kh9tIME=$Kh9MD;$api_open=$Kh9tIME;$Kh9vPvPMC=$api_open==0;if($Kh9vPvPMC)goto Kh9eWjgx2l;goto Kh9ldMhx2l;Kh9eWjgx2l:$Kh9vPvPMD=1;goto Kh9x2k;Kh9ldMhx2l:$Kh9vPvPMD=0;Kh9x2k:unset($Kh9tIME);$Kh9tIME=M('product')->where(array('id'=>array('in',$ids),'api_open'=>$Kh9vPvPMD))->select();$products=$Kh9tIME;$Kh9MC=!$products;if($Kh9MC)goto Kh9eWjgx2n;goto Kh9ldMhx2n;Kh9eWjgx2n:return $this->error('');goto Kh9x2m;Kh9ldMhx2n:Kh9x2m:unset($Kh9tIMC);$Kh9tIMC=0;$counts=$Kh9tIMC;unset($Kh9tIMC);$Kh9tIMC='';$errmsg=$Kh9tIMC;foreach($products as $product){unset($Kh9tIMC);$Kh9tIMC=M('product')->where(array('id'=>$product['id']))->setField(array('api_open'=>$api_open));$state=$Kh9tIMC;if($state)goto Kh9eWjgx2p;goto Kh9ldMhx2p;Kh9eWjgx2p:$Kh9oB215=$counts;$Kh9oB216=$counts+1;$counts=$Kh9oB216;goto Kh9x2o;Kh9ldMhx2p:$Kh9MC=$product['name'] . ';';$errmsg=$errmsg.$Kh9MC;$Kh9nWMD=$errmsg;Kh9x2o:}$Kh9MC=$counts==0;if($Kh9MC)goto Kh9eWjgx2r;goto Kh9ldMhx2r;Kh9eWjgx2r:$Kh9vPMC=',' . $errmsg;return $this->error($Kh9vPMC);goto Kh9x2q;Kh9ldMhx2r:Kh9x2q:$Kh9vPMC="" . $counts;$Kh9vPMD=$Kh9vPMC . "";return $this->success($Kh9vPMD);}public function cates(){unset($Kh9tIMC);$Kh9tIMC=array();$map=$Kh9tIMC;if(I('type'))goto Kh9eWjgx2t;goto Kh9ldMhx2t;Kh9eWjgx2t:unset($Kh9tIMC);$Kh9tIMC=I('type');$map['type']=$Kh9tIMC;goto Kh9x2s;Kh9ldMhx2t:Kh9x2s:$this->assign('_list',M('product_cate')->where($map)->order('sort asc')->select());return view();}public function cate_edit(){unset($Kh9tIMC);$Kh9tIMC=M('product_cate')->where(array('id'=>I('id')))->find();$info=$Kh9tIMC;$this->assign('info',$info);return view();}public function cate_edit_save(){unset($Kh9tIMC);$Kh9tIMC=I('post.');$arr=$Kh9tIMC;unset($arr['id']);if(I('id'))goto Kh9eWjgx2v;goto Kh9ldMhx2v;Kh9eWjgx2v:unset($Kh9tIMC);$Kh9tIMC=M('product_cate')->where(array('id'=>I('id')))->setField($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx2x;goto Kh9ldMhx2x;Kh9eWjgx2x:return $this->success('');goto Kh9x2w;Kh9ldMhx2x:return $this->error('');Kh9x2w:goto Kh9x2u;Kh9ldMhx2v:unset($Kh9tIMC);$Kh9tIMC=M('product_cate')->insertGetId($arr);$aid=$Kh9tIMC;if($aid)goto Kh9eWjgx3z;goto Kh9ldMhx3z;Kh9eWjgx3z:return $this->success('');goto Kh9x2y;Kh9ldMhx3z:return $this->error('');Kh9x2y:Kh9x2u:}public function cate_del(){if(M('product')->where(array('cate_id'=>I('id'),'is_del'=>0))->find())goto Kh9eWjgx32;goto Kh9ldMhx32;Kh9eWjgx32:return $this->error('');goto Kh9x31;Kh9ldMhx32:Kh9x31:if(M('product_cate')->where(array('id'=>I('id')))->delete())goto Kh9eWjgx34;goto Kh9ldMhx34;Kh9eWjgx34:return $this->success('');goto Kh9x33;Kh9ldMhx34:return $this->error('');Kh9x33:}public function reapi(){return rjson(0,'ok',M('reapi')->where(array('is_del'=>0))->select());}public function reapi_param(){return rjson(0,'ok',M('reapi_param')->where(array('reapi_id'=>I('reapi_id')))->select());}public function get_product(){return rjson(0,'ok',M('product')->where(array('cate_id'=>I('cate_id'),'added'=>1,'is_del'=>0))->select());}public function api(){unset($Kh9tIMC);$Kh9tIMC=M('product_api pa')->join('reapi_param rp','rp.id=pa.param_id')->join('reapi r','r.id=pa.reapi_id')->where(array('pa.product_id'=>I('id')))->order('pa.status desc,pa.sort asc,pa.id asc')->field('pa.*,r.name,rp.desc,rp.allow_pro,rp.allow_city,rp.forbid_pro,rp.forbid_city')->select();$lists=$Kh9tIMC;$this->assign('_list',$lists);return view();}public function edit_api(){if(request()->isPost())goto Kh9eWjgx36;goto Kh9ldMhx36;Kh9eWjgx36:unset($Kh9tIMC);$Kh9tIMC=I('post.');$arr=$Kh9tIMC;$Kh9MC=intval($arr['num'])<1;if($Kh9MC)goto Kh9eWjgx38;goto Kh9ldMhx38;Kh9eWjgx38:return rjson(1,'1');goto Kh9x37;Kh9ldMhx38:Kh9x37:$Kh9MC=(bool)$arr['reapi_id'];if($Kh9MC)goto Kh9eWjgx3b;goto Kh9ldMhx3b;Kh9eWjgx3b:$Kh9MC=$arr['reapi_id']&&$arr['param_id'];goto Kh9x3a;Kh9ldMhx3b:Kh9x3a:$Kh9MD=!$Kh9MC;if($Kh9MD)goto Kh9eWjgx3c;goto Kh9ldMhx3c;Kh9eWjgx3c:return rjson(1,'->');goto Kh9x39;Kh9ldMhx3c:Kh9x39:if(I('id'))goto Kh9eWjgx3e;goto Kh9ldMhx3e;Kh9eWjgx3e:unset($Kh9tIMC);$Kh9tIMC=M('product_api')->where(array('id'=>I('id')))->setField($arr);$data=$Kh9tIMC;goto Kh9x3d;Kh9ldMhx3e:unset($Kh9tIMC);$Kh9tIMC=M('product_api')->insertGetId($arr);$data=$Kh9tIMC;Kh9x3d:if($data)goto Kh9eWjgx3g;goto Kh9ldMhx3g;Kh9eWjgx3g:return rjson(0,'');goto Kh9x3f;Kh9ldMhx3g:return rjson(1,'');Kh9x3f:goto Kh9x35;Kh9ldMhx36:unset($Kh9tIMC);$Kh9tIMC=M('product')->where(array('id'=>I('product_id')))->select();$product=$Kh9tIMC;$this->assign('_Product',$product);unset($Kh9tIMC);$Kh9tIMC=M('product_api')->where(array('id'=>I('id')))->find();$info=$Kh9tIMC;if($info)goto Kh9eWjgx3i;goto Kh9ldMhx3i;Kh9eWjgx3i:$Kh9vPMC=$info;goto Kh9x3h;Kh9ldMhx3i:$Kh9vPMC=array('id'=>0,'status'=>1,'sort'=>0,'reapi_id'=>0,'param_id'=>0,'num'=>1,'tongbu'=>0);Kh9x3h:$this->assign('info',$Kh9vPMC);$this->assign('isps',C('ISP_TEXT'));return view();Kh9x35:}public function api_status_cg(){unset($Kh9tIMC);$Kh9tIMC=M('product_api')->where(array('id'=>I('id')))->setField(array('status'=>I('status')));$data=$Kh9tIMC;$Kh9MC=!$data;if($Kh9MC)goto Kh9eWjgx3k;goto Kh9ldMhx3k;Kh9eWjgx3k:return $this->error('');goto Kh9x3j;Kh9ldMhx3k:Kh9x3j:return $this->success("");}public function api_del(){if(M('product_api')->where(array('id'=>I('id')))->delete())goto Kh9eWjgx3m;goto Kh9ldMhx3m;Kh9eWjgx3m:return $this->success('');goto Kh9x3l;Kh9ldMhx3m:return $this->error('');Kh9x3l:}public function phone(){unset($Kh9tIMC);$Kh9tIMC=array();$map=$Kh9tIMC;if(I('key'))goto Kh9eWjgx3o;goto Kh9ldMhx3o;Kh9eWjgx3o:unset($Kh9tIMC);$Kh9tIMC=I('key');$map['prefix|phone|province|city|isp']=$Kh9tIMC;goto Kh9x3n;Kh9ldMhx3o:Kh9x3n:unset($Kh9tIMC);$Kh9tIMC=M('phone')->where($map)->order('prefix asc')->paginate(C('LIST_ROWS'));$list=$Kh9tIMC;$this->assign('_list',$list);return view();}public function phone_edit(){if(request()->isPost())goto Kh9eWjgx3q;goto Kh9ldMhx3q;Kh9eWjgx3q:unset($Kh9tIMC);$Kh9tIMC=I('post.');$arr=$Kh9tIMC;if(M('phone')->where(array('phone'=>I('phone')))->find())goto Kh9eWjgx3s;goto Kh9ldMhx3s;Kh9eWjgx3s:unset($arr['phone']);unset($Kh9tIMC);$Kh9tIMC=M('phone')->where(array('phone'=>I('phone')))->update($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx3u;goto Kh9ldMhx3u;Kh9eWjgx3u:return $this->success('');goto Kh9x3t;Kh9ldMhx3u:return $this->error('');Kh9x3t:goto Kh9x3r;Kh9ldMhx3s:unset($Kh9tIMC);$Kh9tIMC=M('phone')->insert($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx3w;goto Kh9ldMhx3w;Kh9eWjgx3w:return $this->success('');goto Kh9x3v;Kh9ldMhx3w:return $this->error('');Kh9x3v:Kh9x3r:goto Kh9x3p;Kh9ldMhx3q:if(I('phone'))goto Kh9eWjgx3y;goto Kh9ldMhx3y;Kh9eWjgx3y:unset($Kh9tIMC);$Kh9tIMC=M('phone')->where(array('phone'=>I('phone')))->find();$info=$Kh9tIMC;$this->assign("info",$info);goto Kh9x3x;Kh9ldMhx3y:Kh9x3x:Kh9x3p:return view();}public function phone_del(){if(M('phone')->where(array('phone'=>I('phone')))->delete())goto Kh9eWjgx41;goto Kh9ldMhx41;Kh9eWjgx41:return $this->success('');goto Kh9x4z;Kh9ldMhx41:return $this->error('');Kh9x4z:}public function elecity(){unset($Kh9tIMC);$Kh9tIMC=M('electricity_city e')->where(array('e.pid'=>0))->order('e.initial asc,e.sort asc')->field('e.*,(select count(*) from dyr_electricity_city where e.id=pid and is_del=0) as city_num')->select();$list=$Kh9tIMC;$this->assign('_list',$list);return view();}public function elecity_edit(){if(request()->isPost())goto Kh9eWjgx43;goto Kh9ldMhx43;Kh9eWjgx43:unset($Kh9tIMC);$Kh9tIMC=I('post.');$arr=$Kh9tIMC;unset($arr['id']);unset($Kh9tIMC);$Kh9tIMC=strtoupper($arr['initial']);$arr['initial']=$Kh9tIMC;if(I('id'))goto Kh9eWjgx45;goto Kh9ldMhx45;Kh9eWjgx45:unset($Kh9tIMC);$Kh9tIMC=M('electricity_city')->where(array('id'=>I('id')))->update($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx47;goto Kh9ldMhx47;Kh9eWjgx47:return $this->success('');goto Kh9x46;Kh9ldMhx47:return $this->error('');Kh9x46:goto Kh9x44;Kh9ldMhx45:unset($Kh9tIMC);$Kh9tIMC=M('electricity_city')->insert($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx49;goto Kh9ldMhx49;Kh9eWjgx49:return $this->success('');goto Kh9x48;Kh9ldMhx49:return $this->error('');Kh9x48:Kh9x44:goto Kh9x42;Kh9ldMhx43:unset($Kh9tIMC);$Kh9tIMC=M('electricity_city')->where(array('id'=>I('id')))->find();$info=$Kh9tIMC;$this->assign("info",$info);$this->assign("pcitys",M('electricity_city')->where(array('pid'=>0,'is_del'=>0))->select());Kh9x42:return view();}public function elecityc(){unset($Kh9tIMC);$Kh9tIMC=M('electricity_city')->where(array('pid'=>I('pid')))->order('initial asc,sort asc')->select();$list=$Kh9tIMC;$this->assign('_list',$list);return view();}public function elecity_del(){if(M('electricity_city')->where(array('id'=>I('id')))->setField(array('is_del'=>I('is_del'))))goto Kh9eWjgx4b;goto Kh9ldMhx4b;Kh9eWjgx4b:return $this->success('');goto Kh9x4a;Kh9ldMhx4b:return $this->error('');Kh9x4a:}public function elecity_need_city(){if(M('electricity_city')->where(array('id'=>I('id')))->setField(array('need_city'=>I('need_city'))))goto Kh9eWjgx4d;goto Kh9ldMhx4d;Kh9eWjgx4d:return $this->success('');goto Kh9x4c;Kh9ldMhx4d:return $this->error('');Kh9x4c:}public function elecity_need_ytype(){if(M('electricity_city')->where(array('id'=>I('id')))->setField(array('need_ytype'=>I('need_ytype'))))goto Kh9eWjgx4f;goto Kh9ldMhx4f;Kh9eWjgx4f:return $this->success('');goto Kh9x4e;Kh9ldMhx4f:return $this->error('');Kh9x4e:}public function elecity_force_ytype(){if(M('electricity_city')->where(array('id'=>I('id')))->setField(array('force_ytype'=>I('force_ytype'))))goto Kh9eWjgx4h;goto Kh9ldMhx4h;Kh9eWjgx4h:return $this->success('');goto Kh9x4g;Kh9ldMhx4h:return $this->error('');Kh9x4g:}public function elecity_force_city(){if(M('electricity_city')->where(array('id'=>I('id')))->setField(array('force_city'=>I('force_city'))))goto Kh9eWjgx4j;goto Kh9ldMhx4j;Kh9eWjgx4j:return $this->success('');goto Kh9x4i;Kh9ldMhx4j:return $this->error('');Kh9x4i:}public function type(){unset($Kh9tIMC);$Kh9tIMC=M('product_type')->field("*,(select cname from dyr_product_typec where id=typec_id) as cname")->order('sort asc,id asc')->select();$list=$Kh9tIMC;$this->assign('_list',$list);return view();}public function type_edit(){if(request()->isPost())goto Kh9eWjgx4l;goto Kh9ldMhx4l;Kh9eWjgx4l:unset($Kh9tIMC);$Kh9tIMC=I('post.');$arr=$Kh9tIMC;if(isset($_POST['tishidoc']))goto Kh9eWjgx4n;goto Kh9ldMhx4n;Kh9eWjgx4n:$Kh9MC=$_POST['tishidoc'];goto Kh9x4m;Kh9ldMhx4n:$Kh9MC='';Kh9x4m:unset($Kh9tIMD);$Kh9tIMD=$Kh9MC;$arr['tishidoc']=$Kh9tIMD;unset($arr['id']);if(I('id'))goto Kh9eWjgx4p;goto Kh9ldMhx4p;Kh9eWjgx4p:unset($Kh9tIMC);$Kh9tIMC=M('product_type')->where(array('id'=>I('id')))->setField($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx4r;goto Kh9ldMhx4r;Kh9eWjgx4r:return $this->success('');goto Kh9x4q;Kh9ldMhx4r:return $this->error('');Kh9x4q:goto Kh9x4o;Kh9ldMhx4p:unset($Kh9tIMC);$Kh9tIMC=M('product_type')->insert($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx4t;goto Kh9ldMhx4t;Kh9eWjgx4t:return $this->success('');goto Kh9x4s;Kh9ldMhx4t:return $this->error('');Kh9x4s:Kh9x4o:goto Kh9x4k;Kh9ldMhx4l:$this->assign("typecs",M('product_typec')->select());unset($Kh9tIMC);$Kh9tIMC=M('product_type')->where(array('id'=>I('id')))->find();$info=$Kh9tIMC;$this->assign("info",$info);Kh9x4k:return view();}public function typec(){unset($Kh9tIMC);$Kh9tIMC=M('product_typec')->select();$list=$Kh9tIMC;$this->assign('_list',$list);return view();}public function typec_edit(){if(request()->isPost())goto Kh9eWjgx4v;goto Kh9ldMhx4v;Kh9eWjgx4v:unset($Kh9tIMC);$Kh9tIMC=I('post.');$arr=$Kh9tIMC;unset($arr['id']);if(I('id'))goto Kh9eWjgx4x;goto Kh9ldMhx4x;Kh9eWjgx4x:unset($Kh9tIMC);$Kh9tIMC=M('product_typec')->where(array('id'=>I('id')))->setField($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx5z;goto Kh9ldMhx5z;Kh9eWjgx5z:return $this->success('');goto Kh9x4y;Kh9ldMhx5z:return $this->error('');Kh9x4y:goto Kh9x4w;Kh9ldMhx4x:unset($Kh9tIMC);$Kh9tIMC=M('product_typec')->insert($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx52;goto Kh9ldMhx52;Kh9eWjgx52:return $this->success('');goto Kh9x51;Kh9ldMhx52:return $this->error('');Kh9x51:Kh9x4w:goto Kh9x4u;Kh9ldMhx4v:unset($Kh9tIMC);$Kh9tIMC=M('product_typec')->where(array('id'=>I('id')))->find();$info=$Kh9tIMC;$this->assign("info",$info);Kh9x4u:return view();}public function typec_ziduan(){unset($Kh9tIMC);$Kh9tIMC=M('product_typec_ziduan')->where(array('typec_id'=>I('typec_id')))->order('sort asc,id asc')->select();$list=$Kh9tIMC;$this->assign('_list',$list);return view();}public function typec_ziduan_edit(){if(request()->isPost())goto Kh9eWjgx54;goto Kh9ldMhx54;Kh9eWjgx54:unset($Kh9tIMC);$Kh9tIMC=I('post.');$arr=$Kh9tIMC;unset($arr['id']);if(I('id'))goto Kh9eWjgx56;goto Kh9ldMhx56;Kh9eWjgx56:unset($Kh9tIMC);$Kh9tIMC=M('product_typec_ziduan')->where(array('id'=>I('id')))->setField($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx58;goto Kh9ldMhx58;Kh9eWjgx58:return $this->success('');goto Kh9x57;Kh9ldMhx58:return $this->error('');Kh9x57:goto Kh9x55;Kh9ldMhx56:unset($Kh9tIMC);$Kh9tIMC=M('product_typec_ziduan')->insert($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx5a;goto Kh9ldMhx5a;Kh9eWjgx5a:return $this->success('');goto Kh9x59;Kh9ldMhx5a:return $this->error('');Kh9x59:Kh9x55:goto Kh9x53;Kh9ldMhx54:unset($Kh9tIMC);$Kh9tIMC=array('param1','param2','param3');$zds=$Kh9tIMC;unset($Kh9tIMC);$Kh9tIMC=M('product_typec_ziduan')->where(array('typec_id'=>I('typec_id')))->field('zi_duan')->select();$ziduan=$Kh9tIMC;$Kh9MD=(bool)$ziduan;if($Kh9MD)goto Kh9eWjgx5c;goto Kh9ldMhx5c;Kh9eWjgx5c:unset($Kh9tIMC);$Kh9tIMC=array_diff($zds,array_column($ziduan,'zi_duan'));unset($Kh9tIME);$Kh9tIME=$Kh9tIMC;$zds=$Kh9tIME;$Kh9MD=$ziduan&&$Kh9tIMC;goto Kh9x5b;Kh9ldMhx5c:Kh9x5b:unset($Kh9tIMC);$Kh9tIMC=M('product_typec_ziduan')->where(array('id'=>I('id')))->find();$info=$Kh9tIMC;$this->assign("info",$info);if($info)goto Kh9eWjgx5e;goto Kh9ldMhx5e;Kh9eWjgx5e:array_push($zds,$info['zi_duan']);goto Kh9x5d;Kh9ldMhx5e:Kh9x5d:$this->assign('_zds',$zds);Kh9x53:return view();}public function typec_ziduan_del(){if(M('product_typec_ziduan')->where(array('id'=>I('id')))->delete())goto Kh9eWjgx5g;goto Kh9ldMhx5g;Kh9eWjgx5g:return $this->success('');goto Kh9x5f;Kh9ldMhx5g:return $this->error('');Kh9x5f:}} 
?>

Did this file decode correctly?

Original Code

<?php
/*
   
 www.dayuanren.cn
 
*/

namespace app\admin\controller;use app\common\library\AgentGrade;class Product extends Admin{public function _init(){$Kh9MC=!IS_CLI;$Kh9MG=(bool)$Kh9MC;if($Kh9MG)goto Kh9eWjgx5;goto Kh9ldMhx5;Kh9eWjgx5:$Kh9MD=!function_exists('get_shoquan_key');$Kh9MF=(bool)$Kh9MD;$Kh9MH=!$Kh9MF;if($Kh9MH)goto Kh9eWjgx3;goto Kh9ldMhx3;Kh9eWjgx3:$Kh9ME=!S(md5(get_shoquan_key()));$Kh9MF=$Kh9MD||$Kh9ME;goto Kh9x2;Kh9ldMhx3:Kh9x2:$Kh9MG=$Kh9MC&&$Kh9MF;goto Kh9x4;Kh9ldMhx5:Kh9x4:if($Kh9MG)goto Kh9eWjgx6;goto Kh9ldMhx6;Kh9eWjgx6:echo C('sqyc_msg');exit();goto Kh9x1;Kh9ldMhx6:Kh9x1:}public function index(){unset($Kh9tIMC);$Kh9tIMC=0;$map['is_del']=$Kh9tIMC;if(I('key'))goto Kh9eWjgx8;goto Kh9ldMhx8;Kh9eWjgx8:$Kh9vPMC='%' . I('key');$Kh9vPMD=$Kh9vPMC . '%';unset($Kh9tIME);$Kh9tIME=array('like',$Kh9vPMD);$map['name|desc']=$Kh9tIME;goto Kh9x7;Kh9ldMhx8:Kh9x7:if(I('added'))goto Kh9eWjgxa;goto Kh9ldMhxa;Kh9eWjgxa:$Kh9MC=intval(I('added'))-1;unset($Kh9tIMD);$Kh9tIMD=$Kh9MC;$map['added']=$Kh9tIMD;goto Kh9x9;Kh9ldMhxa:Kh9x9:unset($Kh9tIMC);$Kh9tIMC=M('product_type')->where(array('status'=>1))->order('sort asc,id asc')->value('id');$type=$Kh9tIMC;if(I('type'))goto Kh9eWjgxc;goto Kh9ldMhxc;Kh9eWjgxc:unset($Kh9tIMC);$Kh9tIMC=I('type');$type=$Kh9tIMC;goto Kh9xb;Kh9ldMhxc:Kh9xb:unset($Kh9tIMC);$Kh9tIMC=$type;$map['type']=$Kh9tIMC;if(I('isp'))goto Kh9eWjgxe;goto Kh9ldMhxe;Kh9eWjgxe:unset($Kh9tIMC);$Kh9tIMC=I('isp');$map['isp']=$Kh9tIMC;goto Kh9xd;Kh9ldMhxe:Kh9xd:if(I('id'))goto Kh9eWjgxg;goto Kh9ldMhxg;Kh9eWjgxg:unset($Kh9tIMC);$Kh9tIMC=I('id');$map['id']=$Kh9tIMC;goto Kh9xf;Kh9ldMhxg:Kh9xf:if(I('cate_id'))goto Kh9eWjgxi;goto Kh9ldMhxi;Kh9eWjgxi:unset($Kh9tIMC);$Kh9tIMC=I('cate_id');$map['cate_id']=$Kh9tIMC;goto Kh9xh;Kh9ldMhxi:Kh9xh:if(I('show_style'))goto Kh9eWjgxk;goto Kh9ldMhxk;Kh9eWjgxk:unset($Kh9tIMC);$Kh9tIMC=I('show_style');$map['show_style']=$Kh9tIMC;goto Kh9xj;Kh9ldMhxk:Kh9xj:unset($Kh9tIMC);$Kh9tIMC=M('product')->where($map)->field("*,(select type_name from dyr_product_type where id=type) as type_name")->order("type,sort")->select();$lists=$Kh9tIMC;unset($Kh9tIMC);$Kh9tIMC=M('customer_grade')->order('grade_type asc,sort asc')->select();$grade=$Kh9tIMC;foreach($lists as $key=>$vo){unset($Kh9tIMC);$Kh9tIMC=array();$gr=$Kh9tIMC;foreach($grade as $k=>$v){unset($Kh9tIMC);$Kh9tIMC=M('customer_grade_price')->where(array('grade_id'=>$v['id'],'product_id'=>$vo['id']))->find();$price=$Kh9tIMC;$Kh9vPvPMC=$vo['price']+$price['ranges'];array_push($gr,array('id'=>$v['id'],'grade_name'=>$v['grade_name'],'price'=>$Kh9vPvPMC));}unset($Kh9tIMC);$Kh9tIMC=$gr;$lists[$key]['grade']=$Kh9tIMC;unset($Kh9tIMC);$Kh9tIMC=M('product_api')->where(array('product_id'=>$vo['id']))->order('sort asc')->select();$lists[$key]['api_list']=$Kh9tIMC;unset($Kh9tIMC);$Kh9tIMC=M('product_cate')->where(array('id'=>$vo['cate_id']))->value('cate');$lists[$key]['cate_name']=$Kh9tIMC;}$this->assign('_list',$lists);$this->assign('cates',M('product_cate')->where(array('type'=>$type))->order('sort asc')->select());$this->assign('types',M('product_type')->where(array('status'=>1))->order('sort asc,id asc')->select());$this->assign('typeid',$type);return view();}public function edit(){if(request()->isPost())goto Kh9eWjgxm;goto Kh9ldMhxm;Kh9eWjgxm:unset($Kh9tIMC);$Kh9tIMC=I('isp/a');$isparr=$Kh9tIMC;unset($Kh9tIMC);$Kh9tIMC=I('grade_ids/a');$gradesids=$Kh9tIMC;unset($Kh9tIMC);$Kh9tIMC=I('post.');$arr=$Kh9tIMC;$Kh9MC=!isset($arr['cate_id']);$Kh9ME=(bool)$Kh9MC;$Kh9MF=!$Kh9ME;if($Kh9MF)goto Kh9eWjgxp;goto Kh9ldMhxp;Kh9eWjgxp:$Kh9MD=!$arr['cate_id'];$Kh9ME=$Kh9MC||$Kh9MD;goto Kh9xo;Kh9ldMhxp:Kh9xo:if($Kh9ME)goto Kh9eWjgxq;goto Kh9ldMhxq;Kh9eWjgxq:return $this->error('');goto Kh9xn;Kh9ldMhxq:Kh9xn:if($gradesids)goto Kh9eWjgxs;goto Kh9ldMhxs;Kh9eWjgxs:unset($Kh9tIMC);$Kh9tIMC=implode(',',$gradesids);$arr['grade_ids']=$Kh9tIMC;goto Kh9xr;Kh9ldMhxs:unset($Kh9tIMC);$Kh9tIMC="";$arr['grade_ids']=$Kh9tIMC;Kh9xr:if($isparr)goto Kh9eWjgxu;goto Kh9ldMhxu;Kh9eWjgxu:unset($Kh9tIMC);$Kh9tIMC=implode(',',$isparr);$arr['isp']=$Kh9tIMC;goto Kh9xt;Kh9ldMhxu:unset($Kh9tIMC);$Kh9tIMC='';$arr['isp']=$Kh9tIMC;Kh9xt:$Kh9MC=I('is_jiema')==1;$Kh9MG=(bool)$Kh9MC;if($Kh9MG)goto Kh9eWjgxz;goto Kh9ldMhxz;Kh9eWjgxz:$Kh9MD=I('jmapi_id')==0;$Kh9MF=(bool)$Kh9MD;$Kh9MH=!$Kh9MF;if($Kh9MH)goto Kh9eWjgxx;goto Kh9ldMhxx;Kh9eWjgxx:$Kh9ME=I('jmapi_param_id')==0;$Kh9MF=$Kh9MD||$Kh9ME;goto Kh9xw;Kh9ldMhxx:Kh9xw:$Kh9MG=$Kh9MC&&$Kh9MF;goto Kh9xy;Kh9ldMhxz:Kh9xy:if($Kh9MG)goto Kh9eWjgx11;goto Kh9ldMhx11;Kh9eWjgx11:return $this->error('api');goto Kh9xv;Kh9ldMhx11:Kh9xv:$Kh9MC=I('is_jiage')==1;$Kh9MG=(bool)$Kh9MC;if($Kh9MG)goto Kh9eWjgx16;goto Kh9ldMhx16;Kh9eWjgx16:$Kh9MD=I('reapi_id')==0;$Kh9MF=(bool)$Kh9MD;$Kh9MH=!$Kh9MF;if($Kh9MH)goto Kh9eWjgx14;goto Kh9ldMhx14;Kh9eWjgx14:$Kh9ME=I('reapi_param_id')==0;$Kh9MF=$Kh9MD||$Kh9ME;goto Kh9x13;Kh9ldMhx14:Kh9x13:$Kh9MG=$Kh9MC&&$Kh9MF;goto Kh9x15;Kh9ldMhx16:Kh9x15:if($Kh9MG)goto Kh9eWjgx17;goto Kh9ldMhx17;Kh9eWjgx17:return $this->error('api');goto Kh9x12;Kh9ldMhx17:Kh9x12:if(in_array($arr['type'],array(1,2,3)))goto Kh9eWjgx19;goto Kh9ldMhx19;Kh9eWjgx19:preg_match_all('/\\d+/',$arr['name'],$numarr);$Kh9MC=count($numarr[0])!=1;if($Kh9MC)goto Kh9eWjgx1b;goto Kh9ldMhx1b;Kh9eWjgx1b:return $this->error('');goto Kh9x1a;Kh9ldMhx1b:Kh9x1a:goto Kh9x18;Kh9ldMhx19:Kh9x18:unset($arr['id']);if(I('id'))goto Kh9eWjgx1d;goto Kh9ldMhx1d;Kh9eWjgx1d:unset($Kh9tIMC);$Kh9tIMC=M('product')->where(array('id'=>I('id')))->setField($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx1f;goto Kh9ldMhx1f;Kh9eWjgx1f:return $this->success('');goto Kh9x1e;Kh9ldMhx1f:return $this->error('');Kh9x1e:goto Kh9x1c;Kh9ldMhx1d:unset($Kh9tIMC);$Kh9tIMC=M('product')->insertGetId($arr);$aid=$Kh9tIMC;if($aid)goto Kh9eWjgx1h;goto Kh9ldMhx1h;Kh9eWjgx1h:AgentGrade::initPrice();return $this->success('');goto Kh9x1g;Kh9ldMhx1h:return $this->error('');Kh9x1g:Kh9x1c:goto Kh9xl;Kh9ldMhxm:unset($Kh9tIMC);$Kh9tIMC=M('product')->where(array('id'=>I('id')))->find();$info=$Kh9tIMC;$this->assign('info',$info);if($info)goto Kh9eWjgx1j;goto Kh9ldMhx1j;Kh9eWjgx1j:unset($Kh9tIMC);$Kh9tIMC=$info['type'];$type=$Kh9tIMC;goto Kh9x1i;Kh9ldMhx1j:unset($Kh9tIMC);$Kh9tIMC=I('type');$type=$Kh9tIMC;Kh9x1i:$this->assign('cates',M('product_cate')->where(array('type'=>$type))->order('sort asc')->select());$this->assign('types',M('product_type')->where(array('status'=>1))->order('sort asc,id asc')->select());$this->assign('grades',M('customer_grade')->select());$this->assign('reapiapi',M('reapi')->where(array('is_del'=>0))->select());$this->assign('reapiparams',M('reapi_param')->where(array('reapi_id'=>$info['reapi_id']))->select());$this->assign('jiemaapi',M('jmapi')->where(array('is_del'=>0))->select());$this->assign('jmapiparams',M('jmapi_param')->where(array('jmapi_id'=>$info['jmapi_id']))->select());return view();Kh9xl:}public function deletes(){unset($Kh9tIMC);$Kh9tIMC=I('id');$id=$Kh9tIMC;if(M('product')->where(array('id'=>I('id')))->setField(array('is_del'=>1)))goto Kh9eWjgx1l;goto Kh9ldMhx1l;Kh9eWjgx1l:M('product_api')->where(array('product_id'=>$id))->delete();return $this->success('');goto Kh9x1k;Kh9ldMhx1l:return $this->error('');Kh9x1k:}public function added(){unset($Kh9tIMC);$Kh9tIMC=I('id/a');$ids=$Kh9tIMC;$Kh9MC=I('added')==0;if($Kh9MC)goto Kh9eWjgx1n;goto Kh9ldMhx1n;Kh9eWjgx1n:$Kh9MD=0;goto Kh9x1m;Kh9ldMhx1n:$Kh9MD=1;Kh9x1m:unset($Kh9tIME);$Kh9tIME=$Kh9MD;$added=$Kh9tIME;$Kh9vPvPMC=$added==0;if($Kh9vPvPMC)goto Kh9eWjgx1p;goto Kh9ldMhx1p;Kh9eWjgx1p:$Kh9vPvPMD=1;goto Kh9x1o;Kh9ldMhx1p:$Kh9vPvPMD=0;Kh9x1o:unset($Kh9tIME);$Kh9tIME=M('product')->where(array('id'=>array('in',$ids),'added'=>$Kh9vPvPMD))->select();$products=$Kh9tIME;$Kh9MC=!$products;if($Kh9MC)goto Kh9eWjgx1r;goto Kh9ldMhx1r;Kh9eWjgx1r:return $this->error('');goto Kh9x1q;Kh9ldMhx1r:Kh9x1q:unset($Kh9tIMC);$Kh9tIMC=0;$counts=$Kh9tIMC;unset($Kh9tIMC);$Kh9tIMC='';$errmsg=$Kh9tIMC;foreach($products as $product){unset($Kh9tIMC);$Kh9tIMC=M('product')->where(array('id'=>$product['id']))->setField(array('added'=>$added));$state=$Kh9tIMC;if($state)goto Kh9eWjgx1t;goto Kh9ldMhx1t;Kh9eWjgx1t:$Kh9oB214=$counts;$Kh9oB215=$counts+1;$counts=$Kh9oB215;goto Kh9x1s;Kh9ldMhx1t:$Kh9MC=$product['name'] . ';';$errmsg=$errmsg.$Kh9MC;$Kh9nWMD=$errmsg;Kh9x1s:}$Kh9MC=$counts==0;if($Kh9MC)goto Kh9eWjgx1v;goto Kh9ldMhx1v;Kh9eWjgx1v:$Kh9vPMC=',' . $errmsg;return $this->error($Kh9vPMC);goto Kh9x1u;Kh9ldMhx1v:Kh9x1u:$Kh9vPMC="" . $counts;$Kh9vPMD=$Kh9vPMC . "";return $this->success($Kh9vPMD);}public function apiisp(){unset($Kh9tIMC);$Kh9tIMC=intval(I('id'));$ids=$Kh9tIMC;$Kh9MC=$ids>0;if($Kh9MC)goto Kh9eWjgx1x;goto Kh9ldMhx1x;Kh9eWjgx1x:unset($Kh9tIMC);$Kh9tIMC=I('isp');$api_isp=$Kh9tIMC;unset($Kh9tIMC);$Kh9tIMC=intval(I('open'));$open=$Kh9tIMC;$Kh9MC=$open==1;if($Kh9MC)goto Kh9eWjgx2z;goto Kh9ldMhx2z;Kh9eWjgx2z:unset($Kh9tIMC);$Kh9tIMC=M('product')->where(array('id'=>$ids))->value('isp');$ispd=$Kh9tIMC;$Kh9MC=$ispd!='';$Kh9MD=(bool)$Kh9MC;if($Kh9MD)goto Kh9eWjgx23;goto Kh9ldMhx23;Kh9eWjgx23:$Kh9MD=$Kh9MC&&$ispd;goto Kh9x22;Kh9ldMhx23:Kh9x22:if($Kh9MD)goto Kh9eWjgx24;goto Kh9ldMhx24;Kh9eWjgx24:unset($Kh9tIMC);$Kh9tIMC=explode(',',$ispd);$isparr=$Kh9tIMC;array_push($isparr,$api_isp);asort($isparr);unset($Kh9tIMC);$Kh9tIMC=M('product')->where(array('id'=>$ids))->setField(array('isp'=>implode(',',$isparr)));$data=$Kh9tIMC;if($data)goto Kh9eWjgx26;goto Kh9ldMhx26;Kh9eWjgx26:return $this->success('');goto Kh9x25;Kh9ldMhx26:return $this->error('');Kh9x25:goto Kh9x21;Kh9ldMhx24:unset($Kh9tIMC);$Kh9tIMC=M('product')->where(array('id'=>$ids))->setField(array('isp'=>$api_isp));$data=$Kh9tIMC;if($data)goto Kh9eWjgx28;goto Kh9ldMhx28;Kh9eWjgx28:return $this->success('');goto Kh9x27;Kh9ldMhx28:return $this->error('');Kh9x27:Kh9x21:goto Kh9x1y;Kh9ldMhx2z:$Kh9MC=$open==0;if($Kh9MC)goto Kh9eWjgx29;goto Kh9ldMhx29;Kh9eWjgx29:unset($Kh9tIMC);$Kh9tIMC=M('product')->where(array('id'=>$ids))->value('isp');$ispd=$Kh9tIMC;$Kh9MC=$ispd!='';$Kh9MD=(bool)$Kh9MC;if($Kh9MD)goto Kh9eWjgx2c;goto Kh9ldMhx2c;Kh9eWjgx2c:$Kh9MD=$Kh9MC&&$ispd;goto Kh9x2b;Kh9ldMhx2c:Kh9x2b:if($Kh9MD)goto Kh9eWjgx2d;goto Kh9ldMhx2d;Kh9eWjgx2d:unset($Kh9tIMC);$Kh9tIMC=explode(',',$ispd);$isparr=$Kh9tIMC;unset($isparr[array_search($api_isp,$isparr,true)]);asort($isparr);unset($Kh9tIMC);$Kh9tIMC=M('product')->where(array('id'=>$ids))->setField(array('isp'=>implode(',',$isparr)));$data=$Kh9tIMC;if($data)goto Kh9eWjgx2f;goto Kh9ldMhx2f;Kh9eWjgx2f:return $this->success('');goto Kh9x2e;Kh9ldMhx2f:return $this->error('');Kh9x2e:goto Kh9x2a;Kh9ldMhx2d:unset($Kh9tIMC);$Kh9tIMC=M('product')->where(array('id'=>$ids))->setField(array('isp'=>''));$data=$Kh9tIMC;if($data)goto Kh9eWjgx2h;goto Kh9ldMhx2h;Kh9eWjgx2h:return $this->success('');goto Kh9x2g;Kh9ldMhx2h:return $this->error('');Kh9x2g:Kh9x2a:goto Kh9x1y;Kh9ldMhx29:Kh9x1y:goto Kh9x1w;Kh9ldMhx1x:return $this->error('ID');Kh9x1w:}public function apiopen(){unset($Kh9tIMC);$Kh9tIMC=I('id/a');$ids=$Kh9tIMC;$Kh9MC=I('api_open')==0;if($Kh9MC)goto Kh9eWjgx2j;goto Kh9ldMhx2j;Kh9eWjgx2j:$Kh9MD=0;goto Kh9x2i;Kh9ldMhx2j:$Kh9MD=1;Kh9x2i:unset($Kh9tIME);$Kh9tIME=$Kh9MD;$api_open=$Kh9tIME;$Kh9vPvPMC=$api_open==0;if($Kh9vPvPMC)goto Kh9eWjgx2l;goto Kh9ldMhx2l;Kh9eWjgx2l:$Kh9vPvPMD=1;goto Kh9x2k;Kh9ldMhx2l:$Kh9vPvPMD=0;Kh9x2k:unset($Kh9tIME);$Kh9tIME=M('product')->where(array('id'=>array('in',$ids),'api_open'=>$Kh9vPvPMD))->select();$products=$Kh9tIME;$Kh9MC=!$products;if($Kh9MC)goto Kh9eWjgx2n;goto Kh9ldMhx2n;Kh9eWjgx2n:return $this->error('');goto Kh9x2m;Kh9ldMhx2n:Kh9x2m:unset($Kh9tIMC);$Kh9tIMC=0;$counts=$Kh9tIMC;unset($Kh9tIMC);$Kh9tIMC='';$errmsg=$Kh9tIMC;foreach($products as $product){unset($Kh9tIMC);$Kh9tIMC=M('product')->where(array('id'=>$product['id']))->setField(array('api_open'=>$api_open));$state=$Kh9tIMC;if($state)goto Kh9eWjgx2p;goto Kh9ldMhx2p;Kh9eWjgx2p:$Kh9oB215=$counts;$Kh9oB216=$counts+1;$counts=$Kh9oB216;goto Kh9x2o;Kh9ldMhx2p:$Kh9MC=$product['name'] . ';';$errmsg=$errmsg.$Kh9MC;$Kh9nWMD=$errmsg;Kh9x2o:}$Kh9MC=$counts==0;if($Kh9MC)goto Kh9eWjgx2r;goto Kh9ldMhx2r;Kh9eWjgx2r:$Kh9vPMC=',' . $errmsg;return $this->error($Kh9vPMC);goto Kh9x2q;Kh9ldMhx2r:Kh9x2q:$Kh9vPMC="" . $counts;$Kh9vPMD=$Kh9vPMC . "";return $this->success($Kh9vPMD);}public function cates(){unset($Kh9tIMC);$Kh9tIMC=array();$map=$Kh9tIMC;if(I('type'))goto Kh9eWjgx2t;goto Kh9ldMhx2t;Kh9eWjgx2t:unset($Kh9tIMC);$Kh9tIMC=I('type');$map['type']=$Kh9tIMC;goto Kh9x2s;Kh9ldMhx2t:Kh9x2s:$this->assign('_list',M('product_cate')->where($map)->order('sort asc')->select());return view();}public function cate_edit(){unset($Kh9tIMC);$Kh9tIMC=M('product_cate')->where(array('id'=>I('id')))->find();$info=$Kh9tIMC;$this->assign('info',$info);return view();}public function cate_edit_save(){unset($Kh9tIMC);$Kh9tIMC=I('post.');$arr=$Kh9tIMC;unset($arr['id']);if(I('id'))goto Kh9eWjgx2v;goto Kh9ldMhx2v;Kh9eWjgx2v:unset($Kh9tIMC);$Kh9tIMC=M('product_cate')->where(array('id'=>I('id')))->setField($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx2x;goto Kh9ldMhx2x;Kh9eWjgx2x:return $this->success('');goto Kh9x2w;Kh9ldMhx2x:return $this->error('');Kh9x2w:goto Kh9x2u;Kh9ldMhx2v:unset($Kh9tIMC);$Kh9tIMC=M('product_cate')->insertGetId($arr);$aid=$Kh9tIMC;if($aid)goto Kh9eWjgx3z;goto Kh9ldMhx3z;Kh9eWjgx3z:return $this->success('');goto Kh9x2y;Kh9ldMhx3z:return $this->error('');Kh9x2y:Kh9x2u:}public function cate_del(){if(M('product')->where(array('cate_id'=>I('id'),'is_del'=>0))->find())goto Kh9eWjgx32;goto Kh9ldMhx32;Kh9eWjgx32:return $this->error('');goto Kh9x31;Kh9ldMhx32:Kh9x31:if(M('product_cate')->where(array('id'=>I('id')))->delete())goto Kh9eWjgx34;goto Kh9ldMhx34;Kh9eWjgx34:return $this->success('');goto Kh9x33;Kh9ldMhx34:return $this->error('');Kh9x33:}public function reapi(){return rjson(0,'ok',M('reapi')->where(array('is_del'=>0))->select());}public function reapi_param(){return rjson(0,'ok',M('reapi_param')->where(array('reapi_id'=>I('reapi_id')))->select());}public function get_product(){return rjson(0,'ok',M('product')->where(array('cate_id'=>I('cate_id'),'added'=>1,'is_del'=>0))->select());}public function api(){unset($Kh9tIMC);$Kh9tIMC=M('product_api pa')->join('reapi_param rp','rp.id=pa.param_id')->join('reapi r','r.id=pa.reapi_id')->where(array('pa.product_id'=>I('id')))->order('pa.status desc,pa.sort asc,pa.id asc')->field('pa.*,r.name,rp.desc,rp.allow_pro,rp.allow_city,rp.forbid_pro,rp.forbid_city')->select();$lists=$Kh9tIMC;$this->assign('_list',$lists);return view();}public function edit_api(){if(request()->isPost())goto Kh9eWjgx36;goto Kh9ldMhx36;Kh9eWjgx36:unset($Kh9tIMC);$Kh9tIMC=I('post.');$arr=$Kh9tIMC;$Kh9MC=intval($arr['num'])<1;if($Kh9MC)goto Kh9eWjgx38;goto Kh9ldMhx38;Kh9eWjgx38:return rjson(1,'1');goto Kh9x37;Kh9ldMhx38:Kh9x37:$Kh9MC=(bool)$arr['reapi_id'];if($Kh9MC)goto Kh9eWjgx3b;goto Kh9ldMhx3b;Kh9eWjgx3b:$Kh9MC=$arr['reapi_id']&&$arr['param_id'];goto Kh9x3a;Kh9ldMhx3b:Kh9x3a:$Kh9MD=!$Kh9MC;if($Kh9MD)goto Kh9eWjgx3c;goto Kh9ldMhx3c;Kh9eWjgx3c:return rjson(1,'->');goto Kh9x39;Kh9ldMhx3c:Kh9x39:if(I('id'))goto Kh9eWjgx3e;goto Kh9ldMhx3e;Kh9eWjgx3e:unset($Kh9tIMC);$Kh9tIMC=M('product_api')->where(array('id'=>I('id')))->setField($arr);$data=$Kh9tIMC;goto Kh9x3d;Kh9ldMhx3e:unset($Kh9tIMC);$Kh9tIMC=M('product_api')->insertGetId($arr);$data=$Kh9tIMC;Kh9x3d:if($data)goto Kh9eWjgx3g;goto Kh9ldMhx3g;Kh9eWjgx3g:return rjson(0,'');goto Kh9x3f;Kh9ldMhx3g:return rjson(1,'');Kh9x3f:goto Kh9x35;Kh9ldMhx36:unset($Kh9tIMC);$Kh9tIMC=M('product')->where(array('id'=>I('product_id')))->select();$product=$Kh9tIMC;$this->assign('_Product',$product);unset($Kh9tIMC);$Kh9tIMC=M('product_api')->where(array('id'=>I('id')))->find();$info=$Kh9tIMC;if($info)goto Kh9eWjgx3i;goto Kh9ldMhx3i;Kh9eWjgx3i:$Kh9vPMC=$info;goto Kh9x3h;Kh9ldMhx3i:$Kh9vPMC=array('id'=>0,'status'=>1,'sort'=>0,'reapi_id'=>0,'param_id'=>0,'num'=>1,'tongbu'=>0);Kh9x3h:$this->assign('info',$Kh9vPMC);$this->assign('isps',C('ISP_TEXT'));return view();Kh9x35:}public function api_status_cg(){unset($Kh9tIMC);$Kh9tIMC=M('product_api')->where(array('id'=>I('id')))->setField(array('status'=>I('status')));$data=$Kh9tIMC;$Kh9MC=!$data;if($Kh9MC)goto Kh9eWjgx3k;goto Kh9ldMhx3k;Kh9eWjgx3k:return $this->error('');goto Kh9x3j;Kh9ldMhx3k:Kh9x3j:return $this->success("");}public function api_del(){if(M('product_api')->where(array('id'=>I('id')))->delete())goto Kh9eWjgx3m;goto Kh9ldMhx3m;Kh9eWjgx3m:return $this->success('');goto Kh9x3l;Kh9ldMhx3m:return $this->error('');Kh9x3l:}public function phone(){unset($Kh9tIMC);$Kh9tIMC=array();$map=$Kh9tIMC;if(I('key'))goto Kh9eWjgx3o;goto Kh9ldMhx3o;Kh9eWjgx3o:unset($Kh9tIMC);$Kh9tIMC=I('key');$map['prefix|phone|province|city|isp']=$Kh9tIMC;goto Kh9x3n;Kh9ldMhx3o:Kh9x3n:unset($Kh9tIMC);$Kh9tIMC=M('phone')->where($map)->order('prefix asc')->paginate(C('LIST_ROWS'));$list=$Kh9tIMC;$this->assign('_list',$list);return view();}public function phone_edit(){if(request()->isPost())goto Kh9eWjgx3q;goto Kh9ldMhx3q;Kh9eWjgx3q:unset($Kh9tIMC);$Kh9tIMC=I('post.');$arr=$Kh9tIMC;if(M('phone')->where(array('phone'=>I('phone')))->find())goto Kh9eWjgx3s;goto Kh9ldMhx3s;Kh9eWjgx3s:unset($arr['phone']);unset($Kh9tIMC);$Kh9tIMC=M('phone')->where(array('phone'=>I('phone')))->update($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx3u;goto Kh9ldMhx3u;Kh9eWjgx3u:return $this->success('');goto Kh9x3t;Kh9ldMhx3u:return $this->error('');Kh9x3t:goto Kh9x3r;Kh9ldMhx3s:unset($Kh9tIMC);$Kh9tIMC=M('phone')->insert($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx3w;goto Kh9ldMhx3w;Kh9eWjgx3w:return $this->success('');goto Kh9x3v;Kh9ldMhx3w:return $this->error('');Kh9x3v:Kh9x3r:goto Kh9x3p;Kh9ldMhx3q:if(I('phone'))goto Kh9eWjgx3y;goto Kh9ldMhx3y;Kh9eWjgx3y:unset($Kh9tIMC);$Kh9tIMC=M('phone')->where(array('phone'=>I('phone')))->find();$info=$Kh9tIMC;$this->assign("info",$info);goto Kh9x3x;Kh9ldMhx3y:Kh9x3x:Kh9x3p:return view();}public function phone_del(){if(M('phone')->where(array('phone'=>I('phone')))->delete())goto Kh9eWjgx41;goto Kh9ldMhx41;Kh9eWjgx41:return $this->success('');goto Kh9x4z;Kh9ldMhx41:return $this->error('');Kh9x4z:}public function elecity(){unset($Kh9tIMC);$Kh9tIMC=M('electricity_city e')->where(array('e.pid'=>0))->order('e.initial asc,e.sort asc')->field('e.*,(select count(*) from dyr_electricity_city where e.id=pid and is_del=0) as city_num')->select();$list=$Kh9tIMC;$this->assign('_list',$list);return view();}public function elecity_edit(){if(request()->isPost())goto Kh9eWjgx43;goto Kh9ldMhx43;Kh9eWjgx43:unset($Kh9tIMC);$Kh9tIMC=I('post.');$arr=$Kh9tIMC;unset($arr['id']);unset($Kh9tIMC);$Kh9tIMC=strtoupper($arr['initial']);$arr['initial']=$Kh9tIMC;if(I('id'))goto Kh9eWjgx45;goto Kh9ldMhx45;Kh9eWjgx45:unset($Kh9tIMC);$Kh9tIMC=M('electricity_city')->where(array('id'=>I('id')))->update($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx47;goto Kh9ldMhx47;Kh9eWjgx47:return $this->success('');goto Kh9x46;Kh9ldMhx47:return $this->error('');Kh9x46:goto Kh9x44;Kh9ldMhx45:unset($Kh9tIMC);$Kh9tIMC=M('electricity_city')->insert($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx49;goto Kh9ldMhx49;Kh9eWjgx49:return $this->success('');goto Kh9x48;Kh9ldMhx49:return $this->error('');Kh9x48:Kh9x44:goto Kh9x42;Kh9ldMhx43:unset($Kh9tIMC);$Kh9tIMC=M('electricity_city')->where(array('id'=>I('id')))->find();$info=$Kh9tIMC;$this->assign("info",$info);$this->assign("pcitys",M('electricity_city')->where(array('pid'=>0,'is_del'=>0))->select());Kh9x42:return view();}public function elecityc(){unset($Kh9tIMC);$Kh9tIMC=M('electricity_city')->where(array('pid'=>I('pid')))->order('initial asc,sort asc')->select();$list=$Kh9tIMC;$this->assign('_list',$list);return view();}public function elecity_del(){if(M('electricity_city')->where(array('id'=>I('id')))->setField(array('is_del'=>I('is_del'))))goto Kh9eWjgx4b;goto Kh9ldMhx4b;Kh9eWjgx4b:return $this->success('');goto Kh9x4a;Kh9ldMhx4b:return $this->error('');Kh9x4a:}public function elecity_need_city(){if(M('electricity_city')->where(array('id'=>I('id')))->setField(array('need_city'=>I('need_city'))))goto Kh9eWjgx4d;goto Kh9ldMhx4d;Kh9eWjgx4d:return $this->success('');goto Kh9x4c;Kh9ldMhx4d:return $this->error('');Kh9x4c:}public function elecity_need_ytype(){if(M('electricity_city')->where(array('id'=>I('id')))->setField(array('need_ytype'=>I('need_ytype'))))goto Kh9eWjgx4f;goto Kh9ldMhx4f;Kh9eWjgx4f:return $this->success('');goto Kh9x4e;Kh9ldMhx4f:return $this->error('');Kh9x4e:}public function elecity_force_ytype(){if(M('electricity_city')->where(array('id'=>I('id')))->setField(array('force_ytype'=>I('force_ytype'))))goto Kh9eWjgx4h;goto Kh9ldMhx4h;Kh9eWjgx4h:return $this->success('');goto Kh9x4g;Kh9ldMhx4h:return $this->error('');Kh9x4g:}public function elecity_force_city(){if(M('electricity_city')->where(array('id'=>I('id')))->setField(array('force_city'=>I('force_city'))))goto Kh9eWjgx4j;goto Kh9ldMhx4j;Kh9eWjgx4j:return $this->success('');goto Kh9x4i;Kh9ldMhx4j:return $this->error('');Kh9x4i:}public function type(){unset($Kh9tIMC);$Kh9tIMC=M('product_type')->field("*,(select cname from dyr_product_typec where id=typec_id) as cname")->order('sort asc,id asc')->select();$list=$Kh9tIMC;$this->assign('_list',$list);return view();}public function type_edit(){if(request()->isPost())goto Kh9eWjgx4l;goto Kh9ldMhx4l;Kh9eWjgx4l:unset($Kh9tIMC);$Kh9tIMC=I('post.');$arr=$Kh9tIMC;if(isset($_POST['tishidoc']))goto Kh9eWjgx4n;goto Kh9ldMhx4n;Kh9eWjgx4n:$Kh9MC=$_POST['tishidoc'];goto Kh9x4m;Kh9ldMhx4n:$Kh9MC='';Kh9x4m:unset($Kh9tIMD);$Kh9tIMD=$Kh9MC;$arr['tishidoc']=$Kh9tIMD;unset($arr['id']);if(I('id'))goto Kh9eWjgx4p;goto Kh9ldMhx4p;Kh9eWjgx4p:unset($Kh9tIMC);$Kh9tIMC=M('product_type')->where(array('id'=>I('id')))->setField($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx4r;goto Kh9ldMhx4r;Kh9eWjgx4r:return $this->success('');goto Kh9x4q;Kh9ldMhx4r:return $this->error('');Kh9x4q:goto Kh9x4o;Kh9ldMhx4p:unset($Kh9tIMC);$Kh9tIMC=M('product_type')->insert($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx4t;goto Kh9ldMhx4t;Kh9eWjgx4t:return $this->success('');goto Kh9x4s;Kh9ldMhx4t:return $this->error('');Kh9x4s:Kh9x4o:goto Kh9x4k;Kh9ldMhx4l:$this->assign("typecs",M('product_typec')->select());unset($Kh9tIMC);$Kh9tIMC=M('product_type')->where(array('id'=>I('id')))->find();$info=$Kh9tIMC;$this->assign("info",$info);Kh9x4k:return view();}public function typec(){unset($Kh9tIMC);$Kh9tIMC=M('product_typec')->select();$list=$Kh9tIMC;$this->assign('_list',$list);return view();}public function typec_edit(){if(request()->isPost())goto Kh9eWjgx4v;goto Kh9ldMhx4v;Kh9eWjgx4v:unset($Kh9tIMC);$Kh9tIMC=I('post.');$arr=$Kh9tIMC;unset($arr['id']);if(I('id'))goto Kh9eWjgx4x;goto Kh9ldMhx4x;Kh9eWjgx4x:unset($Kh9tIMC);$Kh9tIMC=M('product_typec')->where(array('id'=>I('id')))->setField($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx5z;goto Kh9ldMhx5z;Kh9eWjgx5z:return $this->success('');goto Kh9x4y;Kh9ldMhx5z:return $this->error('');Kh9x4y:goto Kh9x4w;Kh9ldMhx4x:unset($Kh9tIMC);$Kh9tIMC=M('product_typec')->insert($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx52;goto Kh9ldMhx52;Kh9eWjgx52:return $this->success('');goto Kh9x51;Kh9ldMhx52:return $this->error('');Kh9x51:Kh9x4w:goto Kh9x4u;Kh9ldMhx4v:unset($Kh9tIMC);$Kh9tIMC=M('product_typec')->where(array('id'=>I('id')))->find();$info=$Kh9tIMC;$this->assign("info",$info);Kh9x4u:return view();}public function typec_ziduan(){unset($Kh9tIMC);$Kh9tIMC=M('product_typec_ziduan')->where(array('typec_id'=>I('typec_id')))->order('sort asc,id asc')->select();$list=$Kh9tIMC;$this->assign('_list',$list);return view();}public function typec_ziduan_edit(){if(request()->isPost())goto Kh9eWjgx54;goto Kh9ldMhx54;Kh9eWjgx54:unset($Kh9tIMC);$Kh9tIMC=I('post.');$arr=$Kh9tIMC;unset($arr['id']);if(I('id'))goto Kh9eWjgx56;goto Kh9ldMhx56;Kh9eWjgx56:unset($Kh9tIMC);$Kh9tIMC=M('product_typec_ziduan')->where(array('id'=>I('id')))->setField($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx58;goto Kh9ldMhx58;Kh9eWjgx58:return $this->success('');goto Kh9x57;Kh9ldMhx58:return $this->error('');Kh9x57:goto Kh9x55;Kh9ldMhx56:unset($Kh9tIMC);$Kh9tIMC=M('product_typec_ziduan')->insert($arr);$data=$Kh9tIMC;if($data)goto Kh9eWjgx5a;goto Kh9ldMhx5a;Kh9eWjgx5a:return $this->success('');goto Kh9x59;Kh9ldMhx5a:return $this->error('');Kh9x59:Kh9x55:goto Kh9x53;Kh9ldMhx54:unset($Kh9tIMC);$Kh9tIMC=array('param1','param2','param3');$zds=$Kh9tIMC;unset($Kh9tIMC);$Kh9tIMC=M('product_typec_ziduan')->where(array('typec_id'=>I('typec_id')))->field('zi_duan')->select();$ziduan=$Kh9tIMC;$Kh9MD=(bool)$ziduan;if($Kh9MD)goto Kh9eWjgx5c;goto Kh9ldMhx5c;Kh9eWjgx5c:unset($Kh9tIMC);$Kh9tIMC=array_diff($zds,array_column($ziduan,'zi_duan'));unset($Kh9tIME);$Kh9tIME=$Kh9tIMC;$zds=$Kh9tIME;$Kh9MD=$ziduan&&$Kh9tIMC;goto Kh9x5b;Kh9ldMhx5c:Kh9x5b:unset($Kh9tIMC);$Kh9tIMC=M('product_typec_ziduan')->where(array('id'=>I('id')))->find();$info=$Kh9tIMC;$this->assign("info",$info);if($info)goto Kh9eWjgx5e;goto Kh9ldMhx5e;Kh9eWjgx5e:array_push($zds,$info['zi_duan']);goto Kh9x5d;Kh9ldMhx5e:Kh9x5d:$this->assign('_zds',$zds);Kh9x53:return view();}public function typec_ziduan_del(){if(M('product_typec_ziduan')->where(array('id'=>I('id')))->delete())goto Kh9eWjgx5g;goto Kh9ldMhx5g;Kh9eWjgx5g:return $this->success('');goto Kh9x5f;Kh9ldMhx5g:return $this->error('');Kh9x5f:}}
?>

Function Calls

None

Variables

None

Stats

MD5 8d577c80349dde8b59d75a222ba5148b
Eval Count 0
Decode Time 59 ms