Commit f2792ed9 authored by zw's avatar zw

版本 和日报周报

parent 7a99e1ee
......@@ -31,11 +31,11 @@ class Statement extends Basic
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/*$params = array(
$params = array(
"agent_id" => 3,
"time_start" => date("Y-m-d", time()),
"time_end" => date("Y-m-d", time()) . " 23:59:59",
);*/
);
if (!isset($params["agent_id"]) || !isset($params["time_start"]) || !isset($params["time_end"])) {
return $this->response("101", "请求参数错误");
}
......
......@@ -146,7 +146,12 @@ class StatementService
$last_week_end_time = date("Y-m-d" . " 23:59:59", strtotime("$time_start -1 day"));
$where_["quit_time"] = array( 'between', array( $last_week_start_time, $last_week_end_time ) );
$where_["district_id"] = $district_id;
$result = $this->agentModel->countAgentNum($where_);
$result = $this->agentModel->countAgentNum($where_); //上周人数
$conditions_ = $conditions;
$conditions_["district_id"] = $district_id;//本周人数
$results = $this->agentModel->countAgentNum($conditions_);
dump($results);
$last_week_total = 0;
foreach ($result as $key =>$value){
$last_week_total += $value["agent_num"];
......@@ -154,6 +159,8 @@ class StatementService
$paramArr["level"] = array("in",[20,40]);
$agentsResult = $this->agentModel->getAgentsByStoreId($paramArr);
$result[$key]["name"] = count($agentsResult) > 0 ? $agentsResult[0]["name"]: null;
$result[$key]["last_week_num"] = $value["agent_num"];
$result[$key]["agent_num"] = $results[$key]["agent_num"];
}
$district_list["last_week_total"] = $last_week_total;
$district_list["district_list"] = $result;
......
......@@ -61,7 +61,6 @@ class Version extends Basic
if ($param["type"] == 'android' && isset($param["app_path"])) {
$this->response("101", "安卓请上传安装包");
}
$param["type"] = $param["type"] == "android" ? 1 : 0;
$param["create_time"] = date("Y-m-d H:i:s", time());
$param["update_time"] = date("Y-m-d H:i:s", time());
$result = $this->appVersion->addVersion($param);
......
......@@ -415,7 +415,7 @@ class AAgents extends BaseModel
})
->group("a.store_id")
->select();
// echo Db::table($this->table)->getLastSql();
echo Db::table($this->table)->getLastSql();
return $result;
}
......
......@@ -16,10 +16,10 @@ class AppVersion extends Model
* @return mixed
*/
public function getVersion($type = 'android')
public function getVersion($type = '1')
{
$type = $type == 'android' ? 1 : 0;
//$type = $type == 'android' ? 1 : 0;
$param["type"] = $type;
$param["is_del"] = 0;
// return $this->field("id,version_no,type,create_time,intro,CONCAT('".CK_IMG_URL."' , app_path) as app_path")
......
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