Commit b4845bec authored by clone's avatar clone

1

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