display(); } public function MetInfo(){ $id = I('get.id'); $types = I('get.types'); $auer = session('admin_userinfo');//合伙人 $weblogo = M('retail_logo')->where(array('pid'=>$auer['pid']))->getField('weblogo'); $this->assign('weblogo',$weblogo); if(!empty($id)){ $info = M('content')->where(array('hid' => $id))->find(); $info['content'] = htmlspecialchars_decode($info['content']); $title = M('help')->where(array('id' => $id))->find(); $infos = M('help')->where(array('id' => $title['cuid']))->find(); $str['cuid'] = array('neq', 0); $str['heid'] = array('eq',1); $data = M('help')->where($str)->order('addtime asc')->select(); $data = array_slice($data, -10); // dump($data);exit(); $types = 0; $this->assign('id', $id); $this->assign('data', $data); $this->assign('infos', $infos); $this->assign('title', $title); $this->assign('info', $info); } $helps = M('help')->where(array('cuid' => 0,'heid'=>1))->order('id asc')->select(); $help = M('help')->select(); foreach ($helps as $ks => $vals) { $i = 0; $content[$ks]['name'] = $vals['name']; $content[$ks]['id'] = $vals['id']; foreach ($help as $k => $val) { if ($val['cuid'] == $vals['id']) { $content[$ks]['text'][$i++] = $val; } } $content[$ks]['length'] = $i; } $this->assign('types',$types); $this->assign('content', $content); $this->display(); } public function Comproblem(){ $id = I('get.ids'); $types = I('get.types'); $auer = session('admin_userinfo');//合伙人 $weblogo = M('retail_logo')->where(array('pid'=>$auer['pid']))->getField('weblogo'); $this->assign('weblogo',$weblogo); if(!empty($id)){ $problem=M('help')->where(array('cuid'=>$id))->order('id desc')->select(); foreach ($problem as &$val){ $val['addtime'] = date('Y-m-d',$val['addtime']); } $types = 0; $this->assign('problem',$problem); } $helps = M('help')->where(array('cuid' => 0,'heid'=>2))->order('id asc')->select(); if($types == 1){ $where['heid'] = 2; $where['cuid'] = array('neq',0); $problem = M('help')->where($where)->order('addtime desc')->select(); foreach ($problem as &$val){ $val['addtime'] = date('Y-m-d',$val['addtime']); } $this->assign('problem',$problem); // dump($problem); } $this->assign('content', $helps); $this->display(); } public function Amendproblem(){ $id = I('get.id'); $problemid = I('get.ids'); $auer = session('admin_userinfo');//合伙人 $weblogo = M('retail_logo')->where(array('pid'=>$auer['pid']))->getField('weblogo'); $this->assign('weblogo',$weblogo); if(!empty($id)){ $problem=M('help')->where(array('cuid'=>$problemid))->order('id desc')->select(); foreach ($problem as &$val){ $val['addtime'] = date('Y-m-d',$val['addtime']); } $this->assign('problem',$problem); } $helps = M('help')->where(array('cuid' => 0,'heid'=>2))->order('id asc')->select(); $this->assign('content', $helps); $amend = M('content')->where(array('hid'=>$id))->find(); $amend['name'] = M('help')->where(array('id'=>$id))->getField('name'); $amend['content'] = htmlspecialchars_decode($amend['content']); $this->assign('amend',$amend); $this->display(); } }