添加网站文件

This commit is contained in:
2025-12-22 13:59:40 +08:00
commit 117aaf83d1
19468 changed files with 2111999 additions and 0 deletions

View File

@@ -0,0 +1,221 @@
<?php
namespace app\admin\controller;
use think\Db;
use app\admin\logic\ControlLogic;
use app\admin\logic\StaffLogic;
class Control extends AdminBase
{
//品控中心的模板
public function lists(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ControlLogic::lists($get));
}
return $this->fetch();
}
//客户订单回访
public function order_server(){
if ($this->request->isAjax()) {
}
return $this->fetch();
}
//增加回访的内容
public function add(){
if ($this->request->isAjax()) {
$id=$this->request->get('id');
$post = $this->request->post();
$post['order_id']=$id;
$post['createtime']=time();
$orderiofo=Db::name('order_trace')->where('order_id',$id)->find();
if($orderiofo){
$this->_error('订单已经操作回访请勿重复增加');
}
$cumstom=Db::name('order_exe')->where('id',$id)->find();
$post['name']=$cumstom['name'];
$post['phone']=$cumstom['phone'];
$post['staff_id']=$cumstom['staff_id'];
$insert=Db::name('order_trace')->data($post)->insert();
if($insert){
$this->_success('增加反馈成功');
}
$this->_error('增加反馈失败');
}
return $this->fetch();
}
public function edit(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$list=ControlLogic::edit($post);
$this->_success('修改反馈成功');
}
$get=$this->request->get('id');
$this->assign('info', ControlLogic::info($get));
return $this->fetch();
}
public function visit_order(){
if ($this->request->isAjax()) {
$get = $this->request->get();
$this->_success('获取成功', ControlLogic::visit_order($get));
}
return $this->fetch();
}
//增加投诉的内容
public function sale_adds(){
$post = $this->request->post();
$list=ControlLogic::sale_add($post);
$this->_success('增加成功');
}
public function sale_add(){
if ($this->request->isAjax()) {
$this->_success('增加成功');
}
$id=$this->request->get('id');
$this->assign('id', $id);
return $this->fetch();
}
public function sale_edit(){
if ($this->request->isAjax()) {
$post = $this->request->post();
$list=ControlLogic::sale_edit($post);
$this->_success('修改成功');
}
$get=$this->request->get('id');
$this->assign('info',ControlLogic::sale_info($get));
return $this->fetch();
}
public function done(){
$get=$this->request->post('id');
$list=ControlLogic::sale_status($get);
$this->_success('售后订单完成');
}
public function sale_del(){
$get=$this->request->post('id');
$list=ControlLogic::sale_del($get);
$this->_success('删除成功');
}
public function follow(){
$id=$this->request->get('id');
$result['comment']=Db::name('order_sale_log')->where('saly_id',$id)->limit(6)->order('id desc')->select();
foreach($result['comment'] as &$item){
$admin=Db::name('admin')->where('id',$item['admin_id'])->find();
$item['name']=$admin['name'];
$item['phone']=$admin['phone'];
}
$this->assign('result',$result);
$this->assign('id',$id);
return $this->fetch();
}
public function follow_add(){
$post=$this->request->post();
$data=[
'connect'=>$post['reply_msg'],
'saly_id'=>$post['custom_id'],
'admin_id'=>session('admin_info.id'),
'createtime'=>time()
];
$insert=Db::name('order_sale_log')->insertGetId($data);
$datas=Db::name('custom')->where('id',$insert)->find();
$datas['create_time']=date("Y年m月d日 H:i", $datas['create_time']);
$custom=Db::name('admin')->where('id', $datas['admin_id'])->find();
$datas['name']= $custom['name'];
$datas['phone']= $custom['phone'];
if($insert){
$this->_success('增加成功',$datas);
}
}
public function abnormal(){
if ($this->request->isAjax()) {
$id=$this->request->get('id');
$post = $this->request->post();
$post['order_id']=$id;
$post['create_time']=time();
$orderiofo=Db::name('order_abnormal')->where('order_id',$id)->find();
if($orderiofo){
$this->_error('订单已经设置异常');
}
$cumstom=Db::name('order_exe')->where('id',$id)->find();
if(!$cumstom){
$this->_error('订单未设置保洁人员');
}
$post['staff_id']=$cumstom['staff_id'];
$insert=Db::name('order_abnormal')->data($post)->insert();
if($insert){
$abnormal=Db::name('order_exe')->where('id',$id)->update(['abnormal'=>1]);
$this->_success('增加异常成功');
}
$this->_error('增加异常失败');
}
return $this->fetch();
}
public function abnormal_lists(){
if ($this->request->isAjax()) {
$get=$this->request->get();
$list=ControlLogic::abnormal_lists($get);
$this->_success('获取数据成功',$list);
}
$this->assign('staff',StaffLogic::serverstaff());
return $this->fetch();
}
public function abnormal_eidt(){
if ($this->request->isAjax()) {
$post=$this->request->post();
$list=ControlLogic::abnormal_eidt($post);
$this->_success('修改成功');
}
$id=$this->request->get('id');
$this->assign('info',ControlLogic::abnormal_info($id));
return $this->fetch();
}
public function abnormal_del(){
$post=$this->request->post('id');
$del=ControlLogic::abnormal_del($post);
$this->_success('删除成功');
}
//查看图片
public function controlimg(){
$post=$this->request->post('id');
$list=ControlLogic::controlimg($post);
return $this->fetch();
}
//查看图片
public function images(){
$id=$this->request->get('id');
$this->assign('info',ControlLogic::images($id));
return $this->fetch();
}
//处罚的内容
public function punish(){
$id=$this->request->get('id');
$list=ControlLogic::punish($id);
$this->_success('修改成功');
}
}