Commit a6cec67d authored by clone's avatar clone

bug

parent 11ac9d9e
......@@ -29,7 +29,7 @@ class OperationData extends Basic
{
parent::__construct($request);
$this->gHousesModel = new GHouses();
$this->userModel = new Users();
$this->userModel = new Users();
$this->marchInModel = new OMarchInModel();
}
......@@ -40,17 +40,17 @@ class OperationData extends Basic
*/
public function chatUserNum()
{
$params = $this->params;
$params = $this->params;
$where['create_time'] = [ 'between', [ $params['create_time_start'] . ' 00:00:00', $params['create_time_end'] . ' 23:59:59' ] ];
// 发起微聊用户数
$chatRelationModel = new ChatRelation();
$where['from_id'] = [ 'LIKE', '%user_%' ];
$group = '';
$res = $chatRelationModel->getChatUserNumOperation($where, $group);
$chatRelationModel = new ChatRelation();
$where['from_id'] = [ 'LIKE', '%user_%' ];
$group = '';
$res = $chatRelationModel->getChatUserNumOperation($where, $group);
$result["chat_user_all_num"] = $res;
$group = 'from_id';
$res = $chatRelationModel->getChatUserNumOperation($where, $group);
$result["chat_user_num"] = $res;
$group = 'from_id';
$res = $chatRelationModel->getChatUserNumOperation($where, $group);
$result["chat_user_num"] = $res;
return $this->response(200, 'success', $result);
}
......@@ -60,22 +60,22 @@ class OperationData extends Basic
*/
public function userPhoneNum()
{
$params = $this->params;
$params = $this->params;
$where['create_time'] = [ 'between', [ $params['create_time_start'] . ' 00:00:00', $params['create_time_end'] . ' 23:59:59' ] ];
// 先查新所有部门
$district_list = $this->getDistrict();
foreach ($district_list as $key => $v) {
$result_["id"] = $v['id'];
$result_["id"] = $v['id'];
$result_["district_name"] = $v['district_name'];
// 客户来电数
$params = [];
$params = [];
$params["district_id"] = $v['id'];
$params["status"] = 0; //只查询正常状态的经纪人
$field = "sum(call_number) as call_number_total";
$agentModel = new AAgents();
$res = $agentModel->getUserPhoneNum($field, $params);
$params["status"] = 0; //只查询正常状态的经纪人
$field = "sum(call_number) as call_number_total";
$agentModel = new AAgents();
$res = $agentModel->getUserPhoneNum($field, $params);
$result_["user_phone_num"] = isset($res[0]["call_number_total"]) ? $res[0]["call_number_total"] : 0;;
$result[] = $result_;
......@@ -89,26 +89,28 @@ class OperationData extends Basic
*/
public function loginNum()
{
$params = $this->params;
$between = [ 'between', [ $params['create_time_start'] . ' 00:00:00', $params['create_time_end'] . ' 23:59:59' ] ];
$params = $this->params;
$between = [ 'between', [ $params['create_time_start'] . ' 00:00:00', $params['create_time_end'] . ' 23:59:59' ] ];
$where['create_time'] = $between;
// 新增客户数
$addUserNum = $this->userModel->getAddUserNumForOperation($where);
$addUserNum = $this->userModel->getAddUserNumForOperation($where);
$result["add_user_num"] = isset($addUserNum[0]["num"]) ? $addUserNum[0]["num"] : 0;
// 注册客户数
$where = [];
$where['create_time'] = $between;
$where['registration_time'] = array( 'exp', 'is not null' );
$addUserNum = $this->userModel->getAddUserNumForOperation($where);
$where = [];
$where['registration_time'] = $between;
$where['status'] = 0;
// $where['registration_time'] = array( 'exp', 'is not null' );
$addUserNum = $this->userModel->getAddUserNumForOperation($where);
$result["create_user_num"] = isset($addUserNum[0]["num"]) ? $addUserNum[0]["num"] : 0;
// 登录客户数
$where = [];
$where['create_time'] = $between;
$where['last_login_time'] = array( 'exp', 'is not null' );
$addUserNum = $this->userModel->getAddUserNumForOperation($where);
$where = [];
$where['first_login_time'] = $between;
$where['status'] = 0;
//$where['last_login_time'] = array( 'exp', 'is not null' );
$addUserNum = $this->userModel->getAddUserNumForOperation($where);
$result["login_user_num"] = isset($addUserNum[0]["num"]) ? $addUserNum[0]["num"] : 0;
return $this->response(200, 'success', $result);
}
......@@ -126,13 +128,13 @@ class OperationData extends Basic
}
// 商铺总量
$house_res = $this->gHousesModel->getHouseNum($where);
$house_res = $this->gHousesModel->getHouseNum($where);
$result["house_num"] = $house_res;
// 待租商铺数量
$where['residue_num'] = array( 'neq', 0 );
$where['total'] = array( 'neq', 0 );
$house_res = $this->gHousesModel->getHouseNum($where);
$where['residue_num'] = array( 'neq', 0 );
$where['total'] = array( 'neq', 0 );
$house_res = $this->gHousesModel->getHouseNum($where);
$result["have_not_rent_num"] = $house_res;
return $this->response(200, 'success', $result);
......@@ -145,34 +147,34 @@ class OperationData extends Basic
*/
public function houseBargainNum()
{
$params = $this->params;
$params = $this->params;
$where['a.create_time'] = [ 'between', [ $params['create_time_start'] . ' 00:00:00', $params['create_time_end'] . ' 23:59:59' ] ];
// 先查新所有部门
$district_list = $this->getDistrict();
foreach ($district_list as $key => $v) {
$result_["id"] = $v['id'];
$result_["id"] = $v['id'];
$result_["district_name"] = $v['district_name'];
// 商场进场数
$agentIds = $this->getAgentIDsByDistrictId($v['id']);
$where["a.reception_id"] = array( "in", $agentIds );
$res = $this->getFollowUpNum($where, 0);
$agentIds = $this->getAgentIDsByDistrictId($v['id']);
$where["a.reception_id"] = array( "in", $agentIds );
$res = $this->getFollowUpNum($where, 0);
$result_["indoor_shop_look_at_num"] = $res;
// 街铺进场数
$res = $this->getFollowUpNum($where, 1);
$res = $this->getFollowUpNum($where, 1);
$result_["outdoor_shop_look_at_num"] = $res;
// 商场成交数
$obargain = new OBargainModel();
$where_['a.create_time'] = $where['a.create_time'];
$where_['a.agent_id'] = array( "in", $agentIds );
$performanceSum = $obargain->getAddBargainNumOperation($where_, 0);
$obargain = new OBargainModel();
$where_['a.create_time'] = $where['a.create_time'];
$where_['a.agent_id'] = array( "in", $agentIds );
$performanceSum = $obargain->getAddBargainNumOperation($where_, 0);
$result_["indoor_shop_bargain_num"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
// 街铺成交数
$performanceSum = $obargain->getAddBargainNumOperation($where_, 1);
$performanceSum = $obargain->getAddBargainNumOperation($where_, 1);
$result_["outdoor_shop_bargain_num"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
$result[] = $result_;
......@@ -181,8 +183,6 @@ class OperationData extends Basic
}
/**
* 获取部门列表
* @return \think\Response
......@@ -192,10 +192,10 @@ class OperationData extends Basic
$params = [];
$params['status'] = 0;
$field = 'id,district_name';
$field = 'id,district_name';
$district_model = new ADistrict();
$result = $district_model->getDistrict($params, $field);
$result = $district_model->getDistrict($params, $field);
return $result;
}
......@@ -208,7 +208,7 @@ class OperationData extends Basic
{
//shop_type '商铺类型(0商场,1街铺)'
$params['c.shop_type'] = $type == 0 ? 0 : 1;
$addMarchInNum = $this->marchInModel->getMarchInNumOperation($params);
$addMarchInNum = $this->marchInModel->getMarchInNumOperation($params);
return $addMarchInNum;
}
......@@ -220,12 +220,12 @@ class OperationData extends Basic
public function getAgentIDsByDistrictId($district_id)
{
//查询总监下面门店的所有经纪人
$params = [];
$params = [];
$params["district_id"] = $district_id;
$params["status"] = 0; //只查询正常状态的经纪人
$agentModel = new AAgents();
$agentsArr = $agentModel->getAgentsByStoreId($params);
$agent_total = count($agentsArr);
$params["status"] = 0; //只查询正常状态的经纪人
$agentModel = new AAgents();
$agentsArr = $agentModel->getAgentsByStoreId($params);
$agent_total = count($agentsArr);
if ($agent_total > 0) {
$agentIds = "";
foreach ($agentsArr as $key1 => $value1) {
......
......@@ -907,7 +907,7 @@ class Users extends Model
->field($field)
->where($params)
->select();
//dump($this->getLastSql());
// dump($this->getLastSql());
return $result;
}
......
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