Commit 9c80956e authored by clone's avatar clone Committed by hujun

构建

parent 83aeadd4
<?php <?php
namespace app\api_broker\controller;
use app\api_broker\extend\Basic; use app\api_broker\extend\Basic;
use app\api_broker\service\FollowUpService;
use app\model\OFollowUp;
/** /**
* Created by PhpStorm. * Created by PhpStorm.
...@@ -9,24 +12,44 @@ use app\api_broker\extend\Basic; ...@@ -9,24 +12,44 @@ use app\api_broker\extend\Basic;
* Time : 14:24 * Time : 14:24
* Intro: * Intro:
*/ */
class FollowUp extends Basic
class FollowUp extends Basic{ {
private $service_;
private $followUpModel;
public function __construct($request = null) public function __construct($request = null)
{ {
parent::__construct($request); parent::__construct($request);
$this->service_ = new FollowUpService();
$this->followUpModel = new OFollowUp();
} }
/** /**
* 报备 * 报备
* @return \think\Response
*/ */
public function report(){ public function report()
$params = $this->params; {
/* $params = $this->params;
if (!isset($params['report_agent_id']) || !isset($params['report_store_id']) || !isset($params['user_id']) ||
!isset($params['house_ids']) || !isset($params['vehicle']) ) {
return $this->response("101", "请求参数错误");
}*/
$params = array( $params = array(
"report_agent_id" => 1,
"report_store_id" => 1,
"user_id" => 1, "user_id" => 1,
"shop_ids"=> "1,2,3", "house_ids" => "1,2,3",
"" "vehicle" => 10,
"intro" => "123123123",
"to_see_time" => date("Y-m-d H:i:s", time()),
); );
$result = $this->followUpModel->addFollowUp($params);
if($result["code"] == 200){
return $this->response("200", "request success", ["id",$result["msg"]]);
}else{
return $this->response("101", "request faild");
}
$this->response("200","request success",[]);
} }
} }
\ No newline at end of file
<?php
namespace app\api_broker\service;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/1/26
* Time : 16:41
* Intro:
*/
class FollowUpService {
function __construct()
{
}
public function verifyReport(){
}
}
\ No newline at end of file
<?php
namespace app\model;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/1/26
* Time : 16:48
* Intro:
*/
use think\Model;
use think\helper\Time;
use think\Db;
class OFollowUp extends Model
{
// 设置当前模型对应的完整数据表名称
protected $table = 'o_follow_up';
protected $db;
function __construct()
{
$this->db = Db::name($this->table);
}
/**
* 添加报备
* @param $params
* @return array
*/
public function addFollowUp($params)
{
Db::startTrans();
try {
$this->db->insert($params);
$id = $this->id;
Db::commit();
return [ "code" => "200", "msg" => $id ];
} catch (\Exception $e) {
Db::rollback();
return [ "code" => "101", "msg" => "失败,数据异常" ];
}
}
}
\ No newline at end of file
...@@ -211,9 +211,24 @@ Route::group('api', [ ...@@ -211,9 +211,24 @@ Route::group('api', [
//Version //Version
'getVersionNo' => [ 'api/Version/getVersionNo', [ 'method' => 'post' ] ], 'getVersionNo' => [ 'api/Version/getVersionNo', [ 'method' => 'post' ] ],
'agentUserTb' => [ 'api_broker/Client/agentUserTb', [ 'method' => 'get' ] ],//客户列表
'agentUserFollow' => [ 'api_broker/Client/agentUserFollow', [ 'method' => 'get' ] ],//客户列表 ]);
'agentSearch' => [ 'api_broker/Client/agentSearch', [ 'method' => 'get' ] ],//经纪人搜索
Route::group('chat', [
'index' => [ 'chat/AppChat/index', [ 'method' => 'get' ] ],
'userChat' => [ 'chat/AppChat/userChat', [ 'method' => 'post|get' ] ],
'pushMsg' => [ 'chat/AppChat/pushMsg', [ 'method' => 'post|get' ] ],
'getChatHistory' => [ 'chat/AppChat/getChatHistory', [ 'method' => 'post|get' ] ],
'getUserOrAgentInfo' => [ 'chat/AppChat/getUserOrAgentInfo', [ 'method' => 'post|get' ] ],
'uploadImg' => [ 'chat/AppChat/uploadImg', [ 'method' => 'post|get' ] ],
'createGroupByOnlyId' => [ 'chat/Group/createGroupByOnlyId', [ 'method' => 'post|get' ] ],
'delGroup' => [ 'chat/Group/delGroup', [ 'method' => 'post|get' ] ],
'getGroupUser' => [ 'chat/Group/getGroupUser', [ 'method' => 'post|get' ] ],
'addGroupUserByIds' => [ 'chat/Group/addGroupUserByIds', [ 'method' => 'post|get' ] ],
'delGroupUserByIds' => [ 'chat/Group/delGroupUserByIds', [ 'method' => 'post|get' ] ],
'addGroupManage' => [ 'chat/Group/addGroupManage', [ 'method' => 'post|get' ] ],
'delGroupManage' => [ 'chat/Group/delGroupManage', [ 'method' => 'post|get' ] ],
'pushMsg_gethouseinfo' => [ 'chat/AppChat/pushMsg_gethouseinfo', [ 'method' => 'post|get' ] ],
]); ]);
Route::group('task',[ Route::group('task',[
......
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