Commit b4845bec authored by clone's avatar clone

1

parent 830a49f5
......@@ -46,34 +46,31 @@ class StoreFee extends Basic
*/
public function report()
{
$params = $this->params;
if (!isset($params['report_agent_id']) || !isset($params['report_agent_phone']) || !isset($params['report_store_id']) || !isset($params['user_id']) ||
!isset($params['house_ids']) || !isset($params['vehicle'])) {
return $this->response("101", "请求参数错误");
$params = $this->params;
$params = array(
'type' => 1,
'fee_item' => 100,
'total_fee' => 123.43,
'agent_id' => 11,
'store_id' => 12,
'assume_fee' => 111,
'site_id' => 10001,
);
$checkResult = $this->validate($params, "StoreFeeValidate.addApplyFor");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
/* $params = array(
"report_agent_id" => 1,//报备经纪人id
"report_agent_phone" => '13817616471',//报备经纪人id
"report_store_id" => 1,//门店id
"user_id" => 1,//用户id
"house_ids" => "1,2,3",//楼盘id
"vehicle" => 10,//交通工具
"intro" => "123123123",//备注
"predict_see_time" => time(),//预计到看时间
);*/
$agent_id = $params["report_agent_id"];
$agent_phone = $params["report_agent_phone"];
$store_id = $params["report_store_id"];
$user_id = $params["user_id"];
$house_ids = $params["house_ids"];
$vehicle = $params["vehicle"];
$intro = $params["intro"];
$predict_see_time = $params["predict_see_time"];
$type = $params["type"];
$fee_item = $params["fee_item"];
$total_fee = $params["total_fee"];
$agent_id = $params["agent_id"];
$store_id = $params["store_id"];
$assume_fee = $params["vehicle"];
$site_id = $params["assume_fee"];
$predict_see_time = $params["site_id"];
//todo 验证用户id是否正常
$userArr = $this->service_->verifyUser($user_id);
/* $userArr = $this->service_->verifyUser($user_id);
if (!$userArr) {
return $this->response("101", "不存在此用户");
}
......@@ -82,7 +79,7 @@ class StoreFee extends Basic
if ($is_ok > 0) {
$this->userService->setUserSites($user_id, $this->siteId);//设置用户站点 朱伟 2018-10-22
/*记录推送*/
$push = new PushMessageService();
$house_ids_arr = explode(',', $house_ids);
......@@ -91,11 +88,11 @@ class StoreFee extends Basic
$push->pushReportMessage($v, $agent_id, 1, $this->agentId, $user_id); //推送报备信息
}
}
/*记录推送*/
return $this->response("200", "request success", []);
} else {
return $this->response("101", "save exception");
}
}*/
}
......@@ -120,7 +117,7 @@ class StoreFee extends Basic
"page_size"=>15
);*/
$checkResult = $this->validate($params, "PerformanceValidate.verifyCollectionList");
$checkResult = $this->validate($params, "StoreFeeValidate.addApplyFor");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
......@@ -133,8 +130,8 @@ class StoreFee extends Basic
$params["report_agent_id"] = $params["agent_id"];
$result = [];
$agentModel = new AAgents();
$agents_data = $agentModel->getAgentInfo('id,level', $this->agentId);
$agentModel = new AAgents();
$agents_data = $agentModel->getAgentInfo('id,level', $this->agentId);
if (isset($params["is_all"]) && $params["is_all"] == 1) {
$check_type = 1;
if ($agents_data["level"] < 30) {
......
......@@ -11,26 +11,37 @@ use think\Validate;
* Time : 14:51
* Intro:
*/
class BargainValidate extends Validate
class StoreFeeValidate 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',
'type' => 'require|number',
'fee_item' => 'require|number',
'total_fee' => 'require|number',
'agent_id' => 'require|number',
'store_id' => 'require|number',
'assume_fee' => 'require|number',
'site_id' => 'require|number',
];
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' => '与我相关错误',
'type.require' => '报销类型为必填字段',
'type.number' => '报销类型只能为数字',
'fee_item.require' => '费用项目不能为空',
'fee_item.number' => '费用项目只能为数字',
'total_fee.require' => '费用总金额不能为空',
'total_fee.number' => '费用总金额只能为数字',
'agent_id.require' => '申请人不能为空',
'agent_id.number' => '申请人只能为数字',
'store_id.require' => '门店不能为空',
'store_id.number' => '状门店只能为数字',
'assume_fee.require' => '费用承担金额不能为空',
'assume_fee.number' => '费用承担金额只能为数字',
'site_id.require' => '站点不能为空',
'site_id.number' => '站点只能为数字',
];
protected $scene = [
'bargainList' => [ 'submit_agent_id', 'status', 'is_my_correlation' ],
'addApplyFor' => ['type', 'fee_item', 'total_fee', 'agent_id', 'store_id', 'assume_fee', 'site_id'],
];
}
\ 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