140 行
5.0 KiB
PHP
可执行文件
140 行
5.0 KiB
PHP
可执行文件
<?php
|
|
namespace Retail\Controller;
|
|
use Think\Controller;
|
|
class HelpsController extends BaseController
|
|
{
|
|
public function index()
|
|
{
|
|
|
|
$this->display();
|
|
}
|
|
|
|
public function MetInfo(){
|
|
$id = I('get.id');
|
|
$types = I('get.types');
|
|
$muer = session('ls_userinfo');//商户店长
|
|
if($muer['account_type'] == 1)
|
|
{
|
|
$weblogo = M('retail_logo')->where(array('pid'=>$muer['partnerid']))->getField('weblogo');
|
|
}else if($muer['account_type'] == 2)
|
|
{
|
|
//店长
|
|
$id = M('retail_merchant')->where(array('id'=>$muer['merchantid']))->getField('partnerid');
|
|
$weblogo = M('retail_logo')->where(array('pid'=>$id))->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');
|
|
$muer = session('ls_userinfo');//商户店长
|
|
if($muer['account_type'] == 1)
|
|
{
|
|
$weblogo = M('retail_logo')->where(array('pid'=>$muer['partnerid']))->getField('weblogo');
|
|
}else if($muer['account_type'] == 2)
|
|
{
|
|
//店长
|
|
$id = M('retail_merchant')->where(array('id'=>$muer['merchantid']))->getField('partnerid');
|
|
$weblogo = M('retail_logo')->where(array('pid'=>$id))->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');
|
|
$muer = session('ls_userinfo');//商户店长
|
|
if($muer['account_type'] == 1)
|
|
{
|
|
$weblogo = M('retail_logo')->where(array('pid'=>$muer['partnerid']))->getField('weblogo');
|
|
}else if($muer['account_type'] == 2)
|
|
{
|
|
//店长
|
|
$id = M('retail_merchant')->where(array('id'=>$muer['merchantid']))->getField('partnerid');
|
|
$weblogo = M('retail_logo')->where(array('pid'=>$id))->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();
|
|
|
|
}
|
|
|
|
} |