Commit 836a7438 authored by hujun's avatar hujun

跟进跟进标签

parent f6d87bc8
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2018/2/6
* Time: 15:03
*/
namespace app\index\controller;
use app\index\extend\Basic;
use app\model\GLabels;
use think\Session;
class Label extends Basic
{
/**
* 添加标签
*
* @return \think\Response|\think\response\View
*/
public function index(){
$result['code'] = 200;
$result['msg'] = '';
if ($this->request->isPost()) {
if ($this->params['name']) {
$labels = new GLabels();
$data['name'] = $this->params['name'];
$data['operation_id'] = Session::get('userId');
$data['create_time'] = date('Y-m-d H:i:s');
$data['type'] = $this->params['type'];
if ($this->params['id']) {
$result['data'] = $labels->save($data, ['id'=>$this->params['id']]);
} else {
$result['data'] = $labels->save($data);
}
} else {
$result['code'] = 101;
$result['msg'] = 'name is null';
}
$return = $this->response($result['code'], $result['msg'], $result['data']);
} else {
//商铺添加页面
$return = view('index');
}
return $return;
}
/**
* 获取打电话的标签
*
* @return \think\Response
*/
public function getLabelsList() {
$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 GLabels();
$field = '*';
$where['type'] = 1;
$result['data'] = $labels->getList($pageNo, $pageSize, 'id DESC', $field, $where);
return $this->response($result['code'], $result['msg'], $result['data']);
}
}
\ No newline at end of file
......@@ -57,7 +57,7 @@ class Label extends Basic
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$labels = new GLabels();
$field = '*';
$where = '';
$where['type'] = 0;
$result['data'] = $labels->getList($pageNo, $pageSize, 'id DESC', $field, $where);
return $this->response($result['code'], $result['msg'], $result['data']);
}
......
......@@ -215,7 +215,9 @@ Route::group('broker', [
'statusBargain' => [ 'api_broker/OrderLog/statusBargain', [ 'method' => 'get|post' ] ],
'login' => [ 'api_broker/Broker/login', [ 'method' => 'get' ] ], //经纪人登陆
'editClient' => [ 'api_broker/Client/editClient', [ 'method' => 'get|post' ] ],//添加和编辑客户
'getBroker' => ['api_broker/broker/getBroker',['method'=>'get']],
'getBroker' => ['api_broker/broker/getBroker',['method'=>'get']],//获取经纪人列表
'labelEdit' => ['index/broker/index',['method'=>'get|post']], //编辑标签
'getLabelsList' => ['index/broker/getLabelsList',['method'=>'get']], //标签列表
]);
//Route::miss('api/index/miss');//处理错误的url
\ 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