139 行
5.1 KiB
PHP
可执行文件
139 行
5.1 KiB
PHP
可执行文件
<?php
|
|
namespace Agent\Controller;
|
|
use Think\Controller;
|
|
class HelpsController extends BaseController
|
|
{
|
|
public function index()
|
|
{
|
|
$this->display();
|
|
}
|
|
|
|
public function MetInfo(){
|
|
$id = I('get.id');
|
|
$types = I('get.types');
|
|
$guer = session('agent_userinfo');//代理商
|
|
$weblogo = M('retail_logo')->where(array('pid'=>$guer['partnerid']))->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 getMetInfo(){
|
|
$id = I('get.id');
|
|
$types = I('get.types');
|
|
$guer = session('agent_userinfo');//代理商
|
|
$weblogo = M('retail_logo')->where(array('pid'=>$guer['partnerid']))->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);
|
|
$rt['id'] = $id;
|
|
$rt['data'] = $data;
|
|
$rt['infos'] = $infos;
|
|
$rt['title'] = $title;
|
|
$rt['info'] = $info;
|
|
$rt['status'] = 1;
|
|
$rt['msg'] = '查询成功';
|
|
}else{
|
|
$rt['status'] = 0;
|
|
$rt['msg'] = '查询失败';
|
|
}
|
|
$this->ajaxReturn($rt);
|
|
}
|
|
|
|
public function Comproblem(){
|
|
$id = I('get.ids');
|
|
$types = I('get.types');
|
|
$guer = session('agent_userinfo');//代理商
|
|
$weblogo = M('retail_logo')->where(array('pid'=>$guer['partnerid']))->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');
|
|
$guer = session('agent_userinfo');//代理商
|
|
$weblogo = M('retail_logo')->where(array('pid'=>$guer['partnerid']))->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();
|
|
|
|
}
|
|
} |