Commit c67dad8a authored by hujun's avatar hujun

Merge remote-tracking branch 'origin/test' into test

parents d3813b9b 383b0933
...@@ -34,10 +34,10 @@ class AppointmentTime extends Basic ...@@ -34,10 +34,10 @@ class AppointmentTime extends Basic
parent::__construct($request); parent::__construct($request);
$this->appointmentTimeModel = new AppointWatchShop(); $this->appointmentTimeModel = new AppointWatchShop();
//$this->houseInfoModel = new HouseInfos(); //$this->houseInfoModel = new HouseInfos();
$this->houseInfoModel = new GHouses(); $this->houseInfoModel = new GHouses();
$this->dbImg = new GHousesImgs(); $this->dbImg = new GHousesImgs();
$this->appliesModel = new Applies(); $this->appliesModel = new Applies();
$this->evaluateMode = new Evaluate(); $this->evaluateMode = new Evaluate();
} }
/** /**
...@@ -47,15 +47,15 @@ class AppointmentTime extends Basic ...@@ -47,15 +47,15 @@ class AppointmentTime extends Basic
public function addAppointmentSeeShop() public function addAppointmentSeeShop()
{ {
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"user_id" => 116, "user_id" => 116,
"house_id" => 49, "house_id" => 49,
"house_title" => "楼盘1", "house_title" => "楼盘1",
"appellation" => "张三", "appellation" => "张三",
"phone" => "13817616312", "phone" => "13817616312",
"expect_time" => time() + 1000, "expect_time" => time() + 1000,
"other_require" => "没有其他要求" "other_require" => "没有其他要求"
);*/ );*/
//todo 验证楼盘信息 //todo 验证楼盘信息
if (isset($params["house_id"]) && isset($params["house_title"])) { if (isset($params["house_id"]) && isset($params["house_title"])) {
...@@ -76,15 +76,15 @@ class AppointmentTime extends Basic ...@@ -76,15 +76,15 @@ class AppointmentTime extends Basic
return $this->response("101", "预约时间为空,或者小于当前时间"); return $this->response("101", "预约时间为空,或者小于当前时间");
} }
$addPrams = array( $addPrams = array(
'expect_time' => date("Y-m-d H:i:s", $params["expect_time"] / 1000), 'expect_time' => date("Y-m-d H:i:s", $params["expect_time"] / 1000),
'phone' => $params["phone"], 'phone' => $params["phone"],
'house_title' => $params["house_title"], 'house_title' => $params["house_title"],
'house_id' => $params["house_id"], 'house_id' => $params["house_id"],
'appellation' => $params["appellation"], 'appellation' => $params["appellation"],
'user_id' => $params["user_id"], 'user_id' => $params["user_id"],
'other_require' => $params["other_require"], 'other_require' => $params["other_require"],
'create_time' => date("Y-m-d H:i:s", time()), 'create_time' => date("Y-m-d H:i:s", time()),
'update_time' => date("Y-m-d H:i:s", time()) 'update_time' => date("Y-m-d H:i:s", time())
); );
$result = $this->appointmentTimeModel->insertAppointWatchShop($addPrams); $result = $this->appointmentTimeModel->insertAppointWatchShop($addPrams);
if ($result["code"] == 200) { if ($result["code"] == 200) {
...@@ -102,13 +102,13 @@ class AppointmentTime extends Basic ...@@ -102,13 +102,13 @@ class AppointmentTime extends Basic
*/ */
public function getAppointmentSeeShopList() public function getAppointmentSeeShopList()
{ {
/* $params = array( /* $params = array(
"status" => 2, //看铺状态 0待经纪人确认(确认后存agents_id) 1:待看 2:已看' 如果是待看 0,1 已看是2 "status" => 2, //看铺状态 0待经纪人确认(确认后存agents_id) 1:待看 2:已看' 如果是待看 0,1 已看是2
"user_id" => "1",//对应u_users表 "user_id" => "122",//对应u_users表
"phone" => "18112347151",//phone "phone" => "17717536290",//phone
"pageNo" => "1", "pageNo" => "1",
"pageSize" => 15 "pageSize" => 15
);*/ );*/
$params = $this->params; $params = $this->params;
...@@ -124,11 +124,11 @@ class AppointmentTime extends Basic ...@@ -124,11 +124,11 @@ class AppointmentTime extends Basic
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo']; $pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize']; $pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$result = []; $result = [];
if ($params["status"] == 1) { if ($params["status"] == 1) {
$result = $this->getWaitList($pageNo, $pageSize, $params); $result = $this->getWaitList($pageNo, $pageSize, $params);
} elseif ($params["status"] == 2) { } elseif ($params["status"] == 2) {
$result = $this->getYetList($pageNo, $pageSize, $params); $result = $this->getYetListV2($pageNo, $pageSize, $params);
} }
if (count($result) > 0) { if (count($result) > 0) {
...@@ -159,7 +159,7 @@ class AppointmentTime extends Basic ...@@ -159,7 +159,7 @@ class AppointmentTime extends Basic
foreach ($result as $key => $val) { foreach ($result as $key => $val) {
$result[$key]["api_path"] = IMG_PATH; $result[$key]["api_path"] = IMG_PATH;
$param["house_id"] = $val["house_id"]; $param["house_id"] = $val["house_id"];
$param["img_type"] = 1; //默认主图 $param["img_type"] = 1; //默认主图
$result[$key]["images"] = $this->dbImg->getHouseImages($param, 1); $result[$key]["images"] = $this->dbImg->getHouseImages($param, 1);
$houseInfo = $this->houseInfoModel->getHouseDetail("residue_num as room_num_left,external_title as foreign_name", array( "id" => $val["house_id"] )); $houseInfo = $this->houseInfoModel->getHouseDetail("residue_num as room_num_left,external_title as foreign_name", array( "id" => $val["house_id"] ));
...@@ -190,7 +190,35 @@ class AppointmentTime extends Basic ...@@ -190,7 +190,35 @@ class AppointmentTime extends Basic
foreach ($result as $key => $val) { foreach ($result as $key => $val) {
$result[$key]["api_path"] = IMG_PATH; $result[$key]["api_path"] = IMG_PATH;
$param["house_id"] = $val["house_id"]; $param["house_id"] = $val["house_id"];
$param["img_type"] = 1; //默认主图 $param["img_type"] = 1; //默认主图
$result[$key]["images"] = $this->dbImg->getHouseImages($param, 1);
//todo 是否评价
$evaluateResult = $this->evaluateMode->getIsEvaluate(10, $val["id"], $params["user_id"]);
$result[$key]["is_evaluate"] = count($evaluateResult) > 0 ? 1 : 0;
}
return $result;
}
/**
* 已看列表
* @param $pageNo
* @param $pageSize
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public function getYetListV2($pageNo, $pageSize, $params)
{
$field = "a.id,a.phone,c.reception_id as agents_id,c.create_time as expect_time,a.house_id,
d.external_title as house_title,d.residue_num as room_num_left";
$where_["a.user_id"] = $params["user_id"];
$result = $this->appointmentTimeModel->getHaveToSeeList($pageNo, $pageSize, "id desc", $field, $where_);
//获取图片信息
foreach ($result as $key => $val) {
$result[$key]["api_path"] = IMG_PATH;
$param["house_id"] = $val["house_id"];
$param["img_type"] = 1; //默认主图
$result[$key]["images"] = $this->dbImg->getHouseImages($param, 1); $result[$key]["images"] = $this->dbImg->getHouseImages($param, 1);
//todo 是否评价 //todo 是否评价
$evaluateResult = $this->evaluateMode->getIsEvaluate(10, $val["id"], $params["user_id"]); $evaluateResult = $this->evaluateMode->getIsEvaluate(10, $val["id"], $params["user_id"]);
......
...@@ -65,11 +65,11 @@ class AttentionShop extends Basic ...@@ -65,11 +65,11 @@ class AttentionShop extends Basic
public function attentionList() public function attentionList()
{ {
$params = $this->params; $params = $this->params;
$params = array( /* $params = array(
"user_id" => 816, "user_id" => 816,
"pageNo" => 1, "pageNo" => 1,
"pageSize" => 15, "pageSize" => 15,
); );*/
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo']; $pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize']; $pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
......
...@@ -200,10 +200,10 @@ class OrderLog extends Basic ...@@ -200,10 +200,10 @@ class OrderLog extends Basic
public function searchBargainAgents() public function searchBargainAgents()
{ {
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"type" => 1,//1盘方,2客方,3反签,4独家,5合作方 "type" => 1,//1盘方,2客方,3反签,4独家,5合作方
"order_id" => 36, "order_id" => 36,
);*/ );*/
if (!isset($params["type"]) || !isset($params["order_id"])) { if (!isset($params["type"]) || !isset($params["order_id"])) {
return $this->response("101", "请求参数错误"); return $this->response("101", "请求参数错误");
} }
...@@ -480,21 +480,22 @@ class OrderLog extends Basic ...@@ -480,21 +480,22 @@ class OrderLog extends Basic
$data['code'] = 101; $data['code'] = 101;
$data['msg'] = 'Don\'t have info.'; $data['msg'] = 'Don\'t have info.';
} else { } else {
$insert_data['report_id'] = $bargain_data['report_id']; $insert_data['report_id'] = $bargain_data['report_id'];
$insert_data['agent_id'] = $this->params['agent_id']; $insert_data['agent_id'] = $this->params['agent_id'];
$insert_data['order_id'] = $bargain_data['order_id']; $insert_data['order_id'] = $bargain_data['order_id'];
$insert_data['order_no'] = $bargain_data['order_no']; $insert_data['order_no'] = $bargain_data['order_no'];
$insert_data['trade_type'] = $bargain_data['trade_type']; $insert_data['trade_type'] = $bargain_data['trade_type'];
$insert_data['submit_agent_id'] = $bargain_data['submit_agent_id']; $insert_data['submit_agent_id'] = $bargain_data['submit_agent_id'];
$insert_data['price'] = $bargain_data['price']; $insert_data['submit_agent_name'] = $bargain_data['submit_agent_name'];
$insert_data['commission'] = $bargain_data['commission']; $insert_data['price'] = $bargain_data['price'];
$insert_data['status'] = $bargain_data['status']; $insert_data['commission'] = $bargain_data['commission'];
$insert_data['source'] = 1; $insert_data['status'] = $bargain_data['status'];
$insert_data['role'] = empty($this->params['role']) ? 0 : $this->params['role']; $insert_data['source'] = 1;
$insert_data['scale_fee'] = empty($this->params['scale_fee']) ? 0 : $this->params['scale_fee']; $insert_data['role'] = empty($this->params['role']) ? 0 : $this->params['role'];
$insert_data['practical_fee'] = empty($this->params['practical_fee']) ? 0 : $this->params['practical_fee']; $insert_data['scale_fee'] = empty($this->params['scale_fee']) ? 0 : $this->params['scale_fee'];
$insert_data['father_id'] = empty($this->params['id']) ? 0 : $this->params['id']; $insert_data['practical_fee'] = empty($this->params['practical_fee']) ? 0 : $this->params['practical_fee'];
$insert_data['scale'] = empty($this->params['scale']) ? 0 : $this->params['scale']; $insert_data['father_id'] = empty($this->params['id']) ? 0 : $this->params['id'];
$insert_data['scale'] = empty($this->params['scale']) ? 0 : $this->params['scale'];
$data['data']['id'] = $bargain->insertBargain($insert_data); $data['data']['id'] = $bargain->insertBargain($insert_data);
if ($data['data'] == 0) { if ($data['data'] == 0) {
...@@ -513,10 +514,10 @@ class OrderLog extends Basic ...@@ -513,10 +514,10 @@ class OrderLog extends Basic
public function isBargainEnd() public function isBargainEnd()
{ {
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"order_id" => 1,//订单id "order_id" => 1,//订单id
"submit_agent_id" => 1//提交人id "submit_agent_id" => 1//提交人id
);*/ );*/
if (!isset($params["order_id"]) || !isset($params["submit_agent_id"])) { if (!isset($params["order_id"]) || !isset($params["submit_agent_id"])) {
return $this->response("101", "请求参数错误"); return $this->response("101", "请求参数错误");
} }
...@@ -529,9 +530,9 @@ class OrderLog extends Basic ...@@ -529,9 +530,9 @@ class OrderLog extends Basic
$bargain = $bargainModel->getBargainDetail($field, $where_); $bargain = $bargainModel->getBargainDetail($field, $where_);
if (count($bargain) > 0) { if (count($bargain) > 0) {
return $this->response("200","request success",["id"=> $bargain[0]["id"]]); return $this->response("200", "request success", [ "id" => $bargain[0]["id"] ]);
}else{ } else {
return $this->response("200","request null"); return $this->response("200", "request null");
} }
} }
} }
\ No newline at end of file
...@@ -14,7 +14,7 @@ define('LOCAL_IMG_HOST','/resource/lib/Attachments/'); ...@@ -14,7 +14,7 @@ define('LOCAL_IMG_HOST','/resource/lib/Attachments/');
define('PAGESIZE', 15); //分页每页条数 define('PAGESIZE', 15); //分页每页条数
define('ADMIN_URL_TL','https://admin.tonglianjituan.com/'); //B端网址 define('ADMIN_URL_TL','https://admin.tonglianjituan.com/'); //B端网址
//define('TEST_ADMIN_URL_TL','https://dev.tonglianjituan.com/'); //B端网址 //define('TEST_ADMIN_URL_TL','https://dev.tonglianjituan.com/'); //B端网址
define('CURRENT_URL', 'http://'.$_SERVER['HTTP_HOST'].'/'); //取当前域名地址 define('CURRENT_URL', 'https://'.$_SERVER['HTTP_HOST'].'/'); //取当前域名地址
define('HEADERIMGURL', CURRENT_URL . 'static'. DS . 'head_portrait/'); //头像地址 define('HEADERIMGURL', CURRENT_URL . 'static'. DS . 'head_portrait/'); //头像地址
define('AGENTHEADERIMGURL', CURRENT_URL . 'static'. DS . 'agent_head_portrait/'); //头像地址 define('AGENTHEADERIMGURL', CURRENT_URL . 'static'. DS . 'agent_head_portrait/'); //头像地址
define('CHAT_IMG_URL', CURRENT_URL . 'static'. DS . 'chat_image/'); //聊天图片地址 define('CHAT_IMG_URL', CURRENT_URL . 'static'. DS . 'chat_image/'); //聊天图片地址
......
...@@ -367,6 +367,8 @@ class AAgents extends BaseModel ...@@ -367,6 +367,8 @@ class AAgents extends BaseModel
{ {
return Db::table($this->table) return Db::table($this->table)
->field($field) ->field($field)
->limit($pageSize)
->page($pageNo)
->select(); ->select();
} }
......
...@@ -53,7 +53,7 @@ class AppointWatchShop extends BaseModel ...@@ -53,7 +53,7 @@ class AppointWatchShop extends BaseModel
*/ */
public function getAppointWatchShopList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field, $params) public function getAppointWatchShopList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field, $params)
{ {
return $this return $this
->field($field) ->field($field)
->where($params) ->where($params)
->order($order_) ->order($order_)
...@@ -62,6 +62,34 @@ class AppointWatchShop extends BaseModel ...@@ -62,6 +62,34 @@ class AppointWatchShop extends BaseModel
->select(); ->select();
} }
/**
* 预约看铺列表 已看列表
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getHaveToSeeList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field, $params)
{
return $this
->field($field)
->alias("a")
->join("o_report b","a.applies_id = b.id","left")
->join("o_march_in c","c.report_id = b.id","right")
->join("g_houses d","d.id = a.house_id","left")
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->select();
}
/** /**
* 预约看铺总数 * 预约看铺总数
* *
...@@ -70,7 +98,7 @@ class AppointWatchShop extends BaseModel ...@@ -70,7 +98,7 @@ class AppointWatchShop extends BaseModel
*/ */
public function getAppointWatchShopListTotal($params) public function getAppointWatchShopListTotal($params)
{ {
return $this->where($params)->count(); return $this->where($params)->count();
} }
/** /**
...@@ -81,7 +109,8 @@ class AppointWatchShop extends BaseModel ...@@ -81,7 +109,8 @@ class AppointWatchShop extends BaseModel
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function getAppointInfo($field, $params) { public function getAppointInfo($field, $params)
{
return $this->field($field) return $this->field($field)
->where($params) ->where($params)
->find(); ->find();
......
...@@ -44,26 +44,27 @@ class ResultsSummaryTask ...@@ -44,26 +44,27 @@ class ResultsSummaryTask
public function totalAgentResults() public function totalAgentResults()
{ {
set_time_limit(0); set_time_limit(0); // 取消脚本运行时间的超时上限
//todo 1.分页查询经纪人, 2遍历执行,判断一个经纪人在统计表最后一条统计数据的日期 //todo 1.分页查询经纪人, 2遍历执行,判断一个经纪人在统计表最后一条统计数据的日期
//TODO 3.日期加一天并判断是否大于等于当前时间大于return 4.执行此日期的统计,5.当次日期小于当前日期,递归日期加一。继续统计 //TODO 3.日期加一天并判断是否大于等于当前时间大于return 4.执行此日期的统计,5.当次日期小于当前日期,递归日期加一。继续统计
$total = $this->agentsModel->getAgentsCountByTask(); $total = $this->agentsModel->getAgentsCountByTask();
$pageSize = 50; $pageSize = 200;
$pageTotal = ceil($total / $pageSize); $pageTotal = ceil($total / $pageSize);
for ($pageNo = 1; $pageNo <= $pageTotal; $pageNo++) { for ($pageNo = 1; $pageNo <= $pageTotal; $pageNo++) {
$resultArr = $this->agentsModel->getAgentsListByTask($pageNo, $pageSize, "id,store_id,district_id"); $resultArr = $this->agentsModel->getAgentsListByTask($pageNo, $pageSize, "id,store_id,district_id");
$this->executeTotal($resultArr); $this->executeTotal($resultArr);
unset($resultArr); unset($resultArr);
} }
unset($this->agentsModel); unset($this->agentsModel);
unset($this->tAgentTotalModel); unset($this->tAgentTotalModel);
unset($this->houseModel); unset($this->houseModel);
unset($this->userModel); unset($this->userModel);
unset($this->bargainModel); unset($this->bargainModel);
unset($this->reportModel); unset($this->reportModel);
unset($this->marchInModel); unset($this->marchInModel);
unset($this->payLogModel); unset($this->payLogModel);
} }
......
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