Commit 401e435a authored by clone's avatar clone

成交报告详情增加收款信息

parent bc295790
......@@ -52,7 +52,7 @@ class Performance extends Basic
$start_day = !empty($params["start_day"]) ? $params["start_day"] : date("Y-m-01", time());
$list = $this->service_->totalAgent($params["agent_id"], $params["type"], $start_day, $end_day,$params["site_id"]);
$list = $this->service_->totalAgent($params["agent_id"], $params["type"], $start_day, $end_day, $params["site_id"]);
if (count($list) > 0) {
$result["list"] = $list;
$result["start_time"] = $start_day;
......@@ -86,7 +86,7 @@ class Performance extends Basic
$house_id = $params["house_id"];
}
try {
$result = $this->service_->personagePerformance($params["agent_id"], $params["start_time"], $params["end_time"] ." 23:59:59",
$result = $this->service_->personagePerformance($params["agent_id"], $params["start_time"], $params["end_time"] . " 23:59:59",
$params["is_case"], $house_id);
return $this->response("200", "request success", $result);
} catch (Exception $exception) {
......@@ -112,7 +112,7 @@ class Performance extends Basic
return $this->response("101", "请求参数错误");
}
try {
$result = $this->service_->storePerformance($params["agent_id"], $params["start_time"], $params["end_time"]." 23:59:59",$params["site_id"]);
$result = $this->service_->storePerformance($params["agent_id"], $params["start_time"], $params["end_time"] . " 23:59:59", $params["site_id"]);
return $this->response("200", "request success", $result);
} catch (Exception $exception) {
return $this->response("101", "request error,msg:" . $exception);
......@@ -168,14 +168,14 @@ class Performance extends Basic
"end_time" => "2018-04-12",
);*/
if (!isset($params["agent_id"]) || !isset($params["start_time"]) || !isset($params["end_time"] )|| !isset($params["site_id"])) {
if (!isset($params["agent_id"]) || !isset($params["start_time"]) || !isset($params["end_time"]) || !isset($params["site_id"])) {
return $this->response("101", "请求参数错误");
}
Log::write($params, 'storeOrAgentSort'); //记录日志
//城市选择
$site_id = $params["site_id"]? $params["site_id"]: '';
$site_id = $params["site_id"] ? $params["site_id"] : '';
try {
$result = $this->service_->storeSortByDistrictId($params["agent_id"], $params["is_store"], $params["start_time"], $params["end_time"]." 23:59:59",$site_id);
$result = $this->service_->storeSortByDistrictId($params["agent_id"], $params["is_store"], $params["start_time"], $params["end_time"] . " 23:59:59", $site_id);
return $this->response("200", "request success", $result);
} catch (Exception $exception) {
......@@ -468,12 +468,6 @@ class Performance extends Basic
}
}
/**
* 获取时间段实收数据
* @return \think\Response
......@@ -490,7 +484,7 @@ class Performance extends Basic
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
$result = $this->service_->paylogListPcInfo($params["id"],$params["type"], $start_day, $end_day, $page_no, $page_size);
$result = $this->service_->paylogListPcInfo($params["id"], $params["type"], $start_day, $end_day, $page_no, $page_size);
if ($result["code"] == 101) {
return $this->response("101", $result["date"]);
......@@ -514,12 +508,12 @@ class Performance extends Basic
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
$result = $this->service_->marchInListPcInfo($params["id"],$params["type"], $start_day, $end_day, $page_no, $page_size);
$result = $this->service_->marchInListPcInfo($params["id"], $params["type"], $start_day, $end_day, $page_no, $page_size);
if ($result["code"] == 101) {
return $this->response("101", $result["date"]);
} else {
// return $this->response("200", "success", $result["date"]);
return $this->response("200", "success", [ "date" => $result["date"] , "total" => $result["total"] ]);
return $this->response("200", "success", ["date" => $result["date"], "total" => $result["total"]]);
}
}
......@@ -549,12 +543,12 @@ class Performance extends Basic
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
$result = $this->service_->getFollowListPcInfo($params["id"],$params["type"], $start_day, $end_day, $page_no, $page_size);
$result = $this->service_->getFollowListPcInfo($params["id"], $params["type"], $start_day, $end_day, $page_no, $page_size);
if ($result["code"] == 101) {
return $this->response("101", $result["date"]);
} else {
//return $this->response("200", "success", $result["date"]);
return $this->response("200", "success", [ "date" => $result["date"] , "total" => $result["total"] ]);
return $this->response("200", "success", ["date" => $result["date"], "total" => $result["total"]]);
}
}
......@@ -577,7 +571,7 @@ class Performance extends Basic
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
//todo 最后跟进时间
$result = $this->service_->getHousingResourceListPcInfo($params["id"],$params["type"], $start_day, $end_day, $page_no, $page_size);
$result = $this->service_->getHousingResourceListPcInfo($params["id"], $params["type"], $start_day, $end_day, $page_no, $page_size);
if ($result["code"] == 101) {
return $this->response("101", $result["date"]);
} else {
......@@ -602,8 +596,8 @@ class Performance extends Basic
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
$result = $this->service_->getUserResourceListPcInfo($params["id"],$params["type"], $start_day, $end_day,
$page_no, $page_size,$this->siteId);
$result = $this->service_->getUserResourceListPcInfo($params["id"], $params["type"], $start_day, $end_day,
$page_no, $page_size, $this->siteId);
if ($result["code"] == 101) {
return $this->response("101", $result["date"]);
} else {
......@@ -628,7 +622,7 @@ class Performance extends Basic
$page_no = empty($params['page_no']) ? 1 : $params['page_no'];
$page_size = empty($params['page_size']) ? 15 : $params['page_size'];
// dump($params);
$result = $this->service_->getTeamNumPcInfo($params["id"],$params["type"], $page_no, $page_size,$this->siteId);
$result = $this->service_->getTeamNumPcInfo($params["id"], $params["type"], $page_no, $page_size, $this->siteId);
if ($result["code"] == 101) {
return $this->response("101", $result["date"]);
} else {
......@@ -656,7 +650,7 @@ class Performance extends Basic
$request_source_type = !empty($params["request_source_type"]) ? $params["request_source_type"] : 0;
$result = $this->service_->getBargainSumPcInfo($params["id"],$params["type"], $start_day, $end_day, $page_no, $page_size,$request_source_type);
$result = $this->service_->getBargainSumPcInfo($params["id"], $params["type"], $start_day, $end_day, $page_no, $page_size, $request_source_type);
if ($result["code"] == 101) {
return $this->response("101", $result["date"]);
} else {
......@@ -664,4 +658,27 @@ class Performance extends Basic
}
}
/**
* 收款信息
* @return \think\Response
*/
public function collectionListByBargainId()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/* $params = array(
"bargain_id" => 1,
"agent_id" => 80,
);*/
$checkResult = $this->validate($params, "PerformanceValidate.verifyCollectionList");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$result = $this->service_->collectionList($params["bargain_id"]);
return $this->response("200", "success", $result);
}
}
......@@ -894,5 +894,17 @@ class PerformanceService
return [ "code" => 200, "date" => $list ];
}
/**
* @param $bargain_id
* @return false|\PDOStatement|string|\think\Collection
*/
public function collectionList($bargain_id){
$paylogModel = new OPayLogModel();
$orderParams["bargain_id"] = $bargain_id;
$field_pay_log = "a.id,a.create_time,a.bargain_id,a.money,a.type,a.income_time,a.source,c.id as agent_id,c.name,d.store_name";
return $paylogModel->getPayLogByOrderId($field_pay_log,$orderParams);
}
}
\ No newline at end of file
......@@ -22,6 +22,7 @@ class PerformanceValidate extends Validate
'push_id' => 'require',
'is_forbidden' => 'require|in:0,1',
'operator_id' => 'require|number',
'bargain_id' => 'require|number',
];
protected $message = [
......@@ -39,6 +40,8 @@ class PerformanceValidate extends Validate
'is_forbidden.in' => '是否绑定字段值只能为0或1',
'operator_id.require' => '操作人为必填字段',
'operator_id.number' => '操作人编号只能为数字',
'bargain_id.require' => '成交报告编号为必填字段',
'bargain_id.number' => '成交报告编号只能为数字',
];
protected $scene = [
......@@ -47,5 +50,6 @@ class PerformanceValidate extends Validate
'login' => [ 'phone', 'pwd', 'device_id', "push_id" ],
'verifyStatus' => [ 'agent_id', 'device_id' ],
'verifyIsForbidden' => [ 'phone', 'device_id', 'is_forbidden', 'operator_id' ],
'verifyCollectionList' => [ 'agent_id', 'bargain_id'],
];
}
\ No newline at end of file
......@@ -138,6 +138,9 @@ class OPayLogModel extends Model
if (isset($params["house_title"])) {
$where_["b.house_title"] = $params["house_title"];
}
if (isset($params["bargain_id"])) {
$where_["a.bargain_id"] = $params["bargain_id"];
}
$where_["a.is_del"] = 0;
return Db::table($this->table)
->field($field)
......
......@@ -718,6 +718,7 @@ Route::group('broker', [
'performanceList' => ['api_broker/Performance/performanceList', ['method' => 'POST|GET']], //业绩list
'superviseList' => ['api_broker/Performance/superviseList', ['method' => 'POST|GET']], //监督执行list
'officialReceiptsList' => ['api_broker/Performance/officialReceiptsList', ['method' => 'POST|GET']], //实收list
'collectionListByBargainId' => ['api_broker/Performance/collectionListByBargainId', ['method' => 'POST|GET']], //实收list
'paylogListPcInfo' => ['api_broker/Performance/paylogListPcInfo', ['method' => 'POST|GET']], //
'marchInListPcInfo' => ['api_broker/Performance/marchInListPcInfo', ['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