Commit d7913f76 authored by zhuwei's avatar zhuwei

成交报告

parent 61577ee6
<?php
namespace app\index\controller;
use app\api_broker\service\BargainService;
use app\index\extend\Basic;
use app\model\AAgents;
use think\Request;
class Bargain extends Basic
{
private $service_;
private $agentModel;
public function __construct(Request $request = null)
{
parent::__construct($request);
$this->service_ = new BargainService();
$this->agentModel = new AAgents();
}
/**
* 调整 搜索成交报告id
* @return \think\Response
*/
public function bargainListSearchBargainId()
{
$params = $this->params;
/* $params = array(
"submit_agent_id" => 93,
"status" => 1,//0全部 1未结单 2已结单 3 撤销审核 4已撤销
"is_my_correlation" => 1, //是否与我相关 0全部 1与我相关
"keyword" => "17717536291",
"page_no" => 1,
"page_size" => 10,
"bargain_id" =>10
);*/
$checkResult = $this->validate($params, "BargainValidate.bargainList");
if (true !== $checkResult) {
return $this->response("10111", $checkResult);
}
$pageNo = empty($params["page_no"]) ? 1 : $params["page_no"];
$pageSize = empty($params["page_size"]) ? 15 : $params["page_size"];
$submit_agent_id = $params["submit_agent_id"];
$status = $params["status"];
$is_my_correlation = $params["is_my_correlation"];
$keyword = empty($params["keyword"]) ? "" : $params["keyword"];
$bargain_id = empty($params['bargain_id']) ? '':$params['bargain_id'];
/*业务员不允许点击查看全部成交报告 start*/
$agent_field = "a.level";
$agent_res = $this->agentModel->getAgentsInfoByAgentId($agent_field, [ "agent_id" => $submit_agent_id ]);
if(($agent_res[0]['level'] == 10) && ($is_my_correlation == 0)){
return $this->response("101", "暂无权限!");
}
/*业务员不允许点击查看全部成交报告 end*/
$result = $this->service_->getBargainList($pageNo, $pageSize, $submit_agent_id, $status, $is_my_correlation, $keyword, $bargain_id);
return $this->response("200", "success", $result);
}
}
\ No newline at end of file
<?php
namespace app\index\validate;
use think\Validate;
class BargainValidate extends Validate
{
protected $rule = [
'submit_agent_id' => 'require|number',
'status' => 'require|number|in:0,1,2,3,4,5',
'is_my_correlation' => 'require|number|in:0,1',
];
protected $message = [
'submit_agent_id.require' => '经纪人为必填字段',
'submit_agent_id.number' => '经纪人id只能为数字',
'status.require' => '状态参数不能为空',
'status.number' => '状态参数只能为数字',
'status.in' => '状态错误',
'is_my_correlation.require' => '与我相关不能为空',
'is_my_correlation.number' => '与我相关只能是数字',
'is_my_correlation.in' => '与我相关错误',
];
protected $scene = [
'bargainList' => [ 'submit_agent_id', 'status', 'is_my_correlation' ],
];
}
\ No newline at end of file
...@@ -451,6 +451,8 @@ Route::group('index', [ ...@@ -451,6 +451,8 @@ Route::group('index', [
'delSquare' => [ 'index/Square/delSquare', [ 'method' => 'GET|POST' ] ], 'delSquare' => [ 'index/Square/delSquare', [ 'method' => 'GET|POST' ] ],
'editSquare' => [ 'index/Square/editSquare', [ 'method' => 'GET|POST' ] ], 'editSquare' => [ 'index/Square/editSquare', [ 'method' => 'GET|POST' ] ],
'bargainListSearchBargainId' => [ 'index/Bargain/bargainListSearchBargainId', [ 'method' => 'POST|GET' ] ],
]); ]);
......
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