Commit d06ae9fc authored by zhuwei's avatar zhuwei

站点列表

parent b3bb1de1
<?php
namespace app\api_broker\controller;
/**
* Created by PhpStorm.
* User: zhuwei
* Date:2018-10-18
* Time:10:50:55
*/
use app\api_broker\extend\Basic;
use app\model\ASite;
use think\Request;
class Site extends Basic
{
protected $aSite;
public function __construct($request = null)
{
parent::__construct($request);
$this->aSite = new ASite();
}
/**
* 新增数据
* User: 朱伟
* Date:2018-10-18
* Time:10:50:55
*/
// public function addSite()
// {
// header('Access-Control-Allow-Origin:*');
// $params = $this->params;
//
// /*$params = array(
// "name" => 上海站,
// "city" => 上海市,
// );*/
// $checkResult = $this->validate($params, "Site.addSite");
// if (true !== $checkResult) {
// return $this->response("101", $checkResult);
// }
//
//
// //先判断是否已经存在数据
// $field = 'id,is_del';
// //$get_params['name'] = $params["name"];
// $get_params['city'] = $params["city"];
// $res = $this->aSite->getSite($field,$get_params);
//
// if($res){//如果存在
// return $this->response("101", "重复添加");
// }else{//不存在则新增数据
// $insert["name"] = $params['name'];
// $insert["city"] = $params['city'];
// $insert["is_del"] = 0;
//
// $res = $this->aSite->saveSite($insert);//int(1)
// }
//
// if ($res) {
// return $this->response("200", "成功");
// } else {
// return $this->response("101", "失败");
// }
//
// }
/**
* 获取站点列表
* User: 朱伟
* Date:2018-10-18
* Time:10:50:55
*/
public function getSiteList()
{
$params = $this->params;
/*$params = array(
"id" => 5740
);*/
$field = 'id,name,city,is_del';
$get_params['is_del'] = 0;
$res = $this->aSite->getSite($field, $params);
$data['list'] = $res;
return $this->response("200", "成功", $data);
}
/**
* 关闭或开启站点
* @return \think\Response
*/
// public function delImageDepot(){
// $params = $this->params;
// $checkResult = $this->validate($params, "Site.delImageDepot");
// if (true !== $checkResult) {
// return $this->response("101", $checkResult);
// }
// $params_['id'] = $params['id'];
// $params_['is_del'] = $params['is_del'];
// $res = $this->aSite->updateSite($params_);//int(1)
// if($res == 1){
// return $this->response("200", "成功",['data'=>$res]);
// }else{
// return $this->response("300", "失败");
// }
// }
//
// public function siteLogList()
// {
// if (!$this->request->isAjax()) {
// return view('site/siteLogList');
// }
// }
}
\ No newline at end of file
...@@ -647,7 +647,8 @@ Route::group('broker', [ ...@@ -647,7 +647,8 @@ Route::group('broker', [
'addUserCallAgentV2' => [ 'api_broker/CallAgent/addUserCallAgentV2', [ 'method' => 'POST|GET' ] ],//客户来电记录 'addUserCallAgentV2' => [ 'api_broker/CallAgent/addUserCallAgentV2', [ 'method' => 'POST|GET' ] ],//客户来电记录
//站点相关
'getSiteListApp' => [ 'api_broker/Site/getSiteList', [ 'method' => 'POST|GET' ] ], //获取站点列表 朱伟 2018-10-18
]); ]);
......
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