Commit 8404249e authored by zfc's avatar zfc Committed by hujun

标签列表接口

parent 756dd394
...@@ -4,6 +4,7 @@ namespace app\api_broker\controller; ...@@ -4,6 +4,7 @@ namespace app\api_broker\controller;
use app\api_broker\extend\Basic; use app\api_broker\extend\Basic;
use app\model\Agents; use app\model\Agents;
use app\model\ULabels;
use app\model\Users; use app\model\Users;
use app\model\UPhoneFollowPp; use app\model\UPhoneFollowPp;
...@@ -225,4 +226,28 @@ class Client extends Basic ...@@ -225,4 +226,28 @@ class Client extends Basic
$data['page']=$pageNo; $data['page']=$pageNo;
return $this->response(200,'成功',$data); return $this->response(200,'成功',$data);
} }
/**
* 客户标签
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getULabelsListApp() {
$result['code'] = 200;
$result['msg'] = '';
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$labels = new ULabels();
$field = 'id,name,create_time';
$where['type'] = 1;
$result['data']['list'] = $labels->getList($pageNo, $pageSize, 'id DESC', $field, $where);
$result['data']['total'] = $labels->getTotal($where);
return $this->response($result['code'], $result['msg'], $result['data']);
}
} }
...@@ -96,10 +96,13 @@ class Label extends Basic ...@@ -96,10 +96,13 @@ class Label extends Basic
*/ */
public function updateULabel(){ public function updateULabel(){
$group_id=$this->request->param('id'); $group_id=$this->request->param('id');
$table= New ULabels; $table= New ULabels;
if ($this->request->isPost()) { if ($this->request->isPost()) {
$data = input('post.'); $data = input('post.');
$data['operation_id']= Session::get("userinfo.id");//操作人id
if($table->repetition('name',$data['name'])&& empty($data['id'])){ if($table->repetition('name',$data['name'])&& empty($data['id'])){
return $this->response(100, 'url存在重复值'); return $this->response(100, 'url存在重复值');
} }
...@@ -113,7 +116,6 @@ class Label extends Basic ...@@ -113,7 +116,6 @@ class Label extends Basic
$id=$data['id']; $id=$data['id'];
} }
//新增或者编辑数据 //新增或者编辑数据
//prt($data)
if ($table->editData($data,$id)) { if ($table->editData($data,$id)) {
return $this->response(200, '成功'); return $this->response(200, '成功');
} else { } else {
...@@ -140,15 +142,20 @@ class Label extends Basic ...@@ -140,15 +142,20 @@ class Label extends Basic
public function getULabelsList() { public function getULabelsList() {
$result['code'] = 200; $result['code'] = 200;
$result['msg'] = ''; $result['msg'] = '';
//获取当前模块可操作按钮start********************************
$userRule = Session::get('userRule');
$result['data']['cz']=$userRule['cz'];
//获取当前模块可操作按钮end**********************************
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo']; $pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize']; $pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$labels = new GLabels(); $labels = New ULabels;
$field = 'id,name,create_time'; $field = 'id,name,create_time';
$where['type'] = 0; $where['type'] = 1;
$result['data']['list'] = $labels->getList($pageNo, $pageSize, 'id DESC', $field, $where); $result['data']['list'] = $labels->getList($pageNo, $pageSize, 'id DESC', $field, $where);
$result['data']['total'] = $labels->getTotal($where); $result['data']['total'] = $labels->getTotal($where);
return $this->response($result['code'], $result['msg'], $result['data']); return $this->response($result['code'], $result['msg'], $result['data']);
} }
} }
\ No newline at end of file
...@@ -78,7 +78,6 @@ class Basic extends Controller ...@@ -78,7 +78,6 @@ class Basic extends Controller
public function userAuth($requestPath){ public function userAuth($requestPath){
$session = Session::get("userinfo.nav"); $session = Session::get("userinfo.nav");
//prt($session);
$rule = 0; $rule = 0;
if ($session != NULL) { if ($session != NULL) {
//判断当前控制器用户是否拥有进入权限 //判断当前控制器用户是否拥有进入权限
......
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment