Commit 649687aa authored by zhuwei's avatar zhuwei

1

parent 5462e1c6
......@@ -39,7 +39,7 @@ class Statement extends Basic
header('Access-Control-Allow-Origin:*');
$params = $this->params;
// big_log('日报周报获取新增数据-dayStatement');
big_log($params);
// big_log(json_encode($params));
if (!isset($params["agent_id"]) || !isset($params["time_start"]) || !isset($params["time_end"])) {
return $this->response("101", "请求参数错误");
......@@ -248,18 +248,19 @@ class Statement extends Basic
$field = "id,store_id,district_id,level,name,phone,sex,status";
$agentModel = new AAgents();
$agent_result = $agentModel->getAgentById($field, [ "agent_id" => $params["agent_id"] ]);
if(!$agent_result){
return $this->response("200", "request is null");
}
$store_id = $agent_result[0]["store_id"];
$district_id = $agent_result[0]["district_id"];
switch ($agent_result[0]["level"]) {
case 10:
#业务员
$agent_level = 0;
$result = $this->service_->selectStatementForClerk($params["agent_id"],$this->siteId);
$result = $this->service_->selectStatementForClerk($params["agent_id"], $agent_level, $store_id,
$district_id);
break;
case 20:
#店长
......@@ -276,8 +277,7 @@ class Statement extends Basic
#总监
$agent_level = 2;
if($params["type"] == 0 ){ #日报
$result = $this->service_->selectStatementForDistrictWithDay($params["agent_id"], $agent_level,
$store_id,$district_id);
$result = $this->service_->selectStatementForDistrictWithDay($agent_level, $district_id);
}else{ #周报
$result = $this->service_->selectStatementForDistrictWithWeek($params["agent_id"], $agent_level,
$store_id,$district_id);
......
......@@ -42,6 +42,7 @@ class OPartialCommission extends BaseModel
->limit($pageSize)
->page($pageNo)
->select();
big_log($this->getLastSql());
$m_agent = new AAgents();
$fields_str = 'a.id,a.name,a.phone,b.store_name';
foreach ($data as $k => $v) {
......
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