李忠征信平台后端管理系统
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
zhengxin/application/api/controller/Systemfankui.php

64 lines
1.9 KiB

<?php
namespace app\api\controller;
use app\common\controller\Api;
use app\common\library\Ems;
use app\common\library\Sms;
use app\admin\model\system\Fankui;
use app\admin\model\system\fankui\Type as FKType;
use fast\Random;
use think\Config;
use think\Validate;
use fast\Tree;
/**
* 系统基础设置接口
*/
class Systemfankui extends Api
{
protected $noNeedLogin = ['gettype'];
protected $noNeedRight = '*';
public function _initialize()
{
parent::_initialize();
$this->model = new Fankui;
}
public function gettype(){
//获取反馈类型
$info = FKType::where('status',1)->select();
Tree::instance()->init($info);
$info = Tree::instance()->getTreeArray(0);
return $this->success('获取成功',$info);
}
public function getlist(){
$data = $this->request->post();
if($this->request->isPost()){
$uid = $this->auth->id;
$offset = $data['offset'];
$limit = $data['limit'];
$where['user_id'] = $uid;
$order = ['createtime'=>'desc'];
$list = $this->model->getlist($where, $order, $offset, $limit);
return $this->success('获取成功',$list);
}
}
public function setfankui(){
$data = $this->request->post();
if($this->request->isPost()){
$uid = $this->auth->id;
$insert['user_id'] = $uid;
$insert['type'] = $data['type'];
$insert['type_item'] = $data['type_item'];
$insert['content'] = $data['content'];
$insert['image'] = $data['image'];
$insert['phone'] = $data['phone'];
$insert['email'] = $data['email'];
$insert['createtime'] = date("Y-m-d H:i:s");
$this->model->insert($insert);
return $this->success('提交成功');
}
return $this->error("非法请求");
}
}