Commit 037cdd07 authored by zw's avatar zw

Merge branch '1130-v3.0.1' into test

# Conflicts: # application/api/service/PushClientService.php
parents 3da47d3f 174ae515
......@@ -11,6 +11,7 @@ use app\model\GHouses;
use app\model\GHousesImgs;
use app\model\GHousesToAgents;
use app\model\GImageDepot;
use app\model\OPushMessageModel;
use app\model\OReportModel;
use app\model\Users;
......@@ -294,5 +295,34 @@ class AppointmentTime extends Basic
}
/**
* 检查是有未评价
*
* @return \think\Response
*/
public function checkAppointment()
{
$data['name'] = $msg = "";
try {
$m_push = new OPushMessageModel();
$where['user_id'] = $this->userId;
// $where['user_id'] = 122;
$where['status'] = 0;
$id = $m_push->getListByWhere('id,operation_id,message', $where, 1, 1);
if (empty($id[0]['id'])) {
$data['is_alert'] = 0;
} else {
$data['name'] = $id[0]['message'];
$data['is_alert'] = 1;
}
} catch (\Exception $e) {
$data = [];
$msg = "内部错误:".$e->getMessage();
}
return $this->response(200, $msg, $data);
}
}
\ No newline at end of file
......@@ -9,6 +9,7 @@ use app\model\Evaluate;
use app\model\EvaluateSign;
use app\model\OBargainModel;
use app\model\OMarchInModel;
use app\model\OPushMessageModel;
/**
* Description of Agents
......@@ -173,6 +174,9 @@ class Broker extends Basic
]);
if ($evaluate->id) {
$m_push = new OPushMessageModel();
$m_push->updateData(['status'=>1], ['user_id' => $this->userId, 'house_id' => $params['house_id'], 'operation_id' => $params['agents_id'],]);
$data['data'] = [ 'id' => $evaluate->id ];
$data['status'] = 200;
$data['msg'] = '评价成功';
......
......@@ -64,6 +64,7 @@ class Shop extends Basic
"site_area" => 4, //来源 1c首页 2c搜索 6pc官网商铺列表
// "title" => "vv", //1,2 external_title ,3,4internal_title
"house_id" => 4,
"fit_industry_type" => "",//适合业态
"business_id" => 4,
"is_carefully_chosen" => 0, //精选商铺--0否1是
"shop_type" => 0, //商铺类型(0商场,1街铺)
......@@ -93,8 +94,9 @@ class Shop extends Basic
if (empty($params['city']) && ($params['city'] == "杭州市" || $params['city'] == "上海市")) {
return $this->response("101", "城市不能为空");
}
$field = "id,external_title as title,external_address as address,city,disc,business_district_id,status,industry_type,external_image_id
,shop_area_start,shop_area_end,shop_type,residue_num,shop_sign,is_carefully_chosen,rent_type,rent_price,is_show_image";
$field = "id,external_title as title,external_address as address,city,disc,business_district_id,status,industry_type,
external_image_id,shop_area_start,shop_area_end,shop_type,residue_num,shop_sign,is_carefully_chosen,rent_type,
rent_price,is_show_image,fit_industry_type";
$conditions["city"] = trim($params['city']);
......@@ -122,6 +124,9 @@ class Shop extends Basic
$conditions['create_time'] = array('between', array($start_time, $end_time));
}
if (isset($params['fit_industry_type'])) { //适合业态
$conditions['fit_industry_type'] = array('like', "%" . trim($params['fit_industry_type']) . "%");
}
$order_ = "";
$spTagArr = array();
switch ($params['site_area']) {
......@@ -325,7 +330,7 @@ class Shop extends Basic
b.enter_num,b.external_item_advantage as item_advantage,b.sign_rule,b.do_business_date, b.opening_date,b.traffic,
b.auditorium,b.tiny_brochure_url,b.start_business_date,b.fee_rule,b.age_limit,b.payment_month,b.deposit_month,b.external_slotting_fee,
b.area_width,b.depth,b.electric_quantity,b.voltage,b.exhaust_fume,b.running_water,b.downriver,b.business_scope,b.decoration
,b.rim_mating,b.section,b.crowd,b.other,a.is_show_image";
,b.rim_mating,b.section,b.crowd,b.other,a.is_show_image,a.fit_industry_type";
$conditions['a.status'] = array("eq", 1);
$conditions['a.is_show'] = array('eq', 0); //c端只显示公开楼盘
......
......@@ -76,7 +76,7 @@ class Site extends Basic
$field = 'id,name,city,is_del';
$get_params['is_del'] = 0;
$res = $this->aSite->getSite($field, $params);
$res = $this->aSite->getSite($field, $get_params);
return $this->response("200", "成功", $res);
}
......
......@@ -44,8 +44,7 @@ class PushClientService
if (empty($message)) {
$m_agent = new AAgents();
$name = $m_agent->getAgentsById($operation_id, 'name');
$message = '同联商业邀请您评价经纪人'.$name.'对商铺的带看服务';
$message = $m_agent->getAgentsById($operation_id, 'name');
}
$data['message'] = $message;
$data['order_id'] = $order_id;
......@@ -59,8 +58,8 @@ class PushClientService
*/
public function pushRecord()
{
$title = $type = '';
$field = 'id,addressee_id,type,message,house_id,user_id,order_id';
$title = $type = $content = '';
$field = 'id,operation_id,type,message,house_id,user_id,order_id';
$where['status'] = $id = $is_forbidden = 0;
$push_data = $this->m_push->getDateLimit($field, $where, 100);
......@@ -68,12 +67,11 @@ class PushClientService
switch ($v['type']) {
case 0 :
$title = "评价经纪人";
$id = $v['house_id'];
$type = 'evaluate';
$content = '同联商业邀请您评价经纪人'.$v['message'].'对商铺的带看服务';
break;
}
$this->pushAgentAllDeviceId($v['addressee_id'], $title, $v['message'], $type, $id, $is_forbidden,$v['house_id'], $v['order_id']);
$this->pushAgentAllDeviceId($v['operation_id'], $title, $content, $type, $v['user_id'], $is_forbidden, $v['house_id'], $v['order_id'], $v['message']);
$update_data['status'] = 1;
$update_data['send_time'] = date('Y-m-d H:i:s');
......@@ -91,21 +89,28 @@ class PushClientService
* @param int $is_forbidden
* @param int $house_id
* @param int $order_id
* @param $name
* @return array|bool
* @throws \Exception
*/
public function pushAgentAllDeviceId($id, $title, $content, $type = 0, $user_id = 0, $is_forbidden = 0, $house_id = 0, $order_id = 0)
public function pushAgentAllDeviceId($id, $title, $content, $type = 0, $user_id = 0, $is_forbidden = 0, $house_id = 0, $order_id = 0, $name)
{
if (empty($id)) {
if (empty($user_id)) {
return false;
}
$push = new GeTuiUtils('client');
$chat = new ChatUser();
$chat_ext = new ChatUserExt();
$ext_id = $chat->getFieldValue('id', ['uesr_id'=>$user_id, 'type'=>2]);
$ext_id = $chat->getFieldValue('id', ['user_id'=>$user_id, 'type'=>2]);
if (empty($ext_id)) {
$result = false;
} else {
$push_id = $chat_ext->getInfo('push_id', ['ext_id'=>$ext_id, 'is_forbidden'=>$is_forbidden]);
$result = $push->public_push_message_for_one($user_id, $push_id['push_id'], $title, $content, $type, $user_id, $house_id, $order_id);
$result = $push->public_push_message_for_one($id, $push_id['push_id'], $title, $content, $type, $user_id, $house_id, $order_id, $name);
}
return $result;
}
}
\ No newline at end of file
......@@ -175,10 +175,11 @@ class GeTuiUtils {
* @param $user_id
* @param $house_id
* @param $order_id
* @param $name
* @return array
* @throws \Exception
*/
function public_push_message_for_one($id, $device_id, $title, $content, $type = 'other', $user_id, $house_id, $order_id)
function public_push_message_for_one($id, $device_id, $title, $content, $type = 'other', $user_id, $house_id, $order_id, $name = "")
{
$home_url = $this->http_host();
$data['agent_id'] = $id;
......@@ -190,7 +191,7 @@ class GeTuiUtils {
'content' => $content,
'type' => $type,
'url' => '',
'name' => $title,
'name' => $name,
'id' => $user_id,
'house_id' => $house_id,
'order_id' => $order_id,
......
......@@ -52,6 +52,11 @@ class MapFindHouse extends Basic
return $this->response("101", "坐标传入有误");
}
$conditions = [];
$source = $params["source"];
if($source == 2){
$conditions['status'] = array('eq', 1); //只显示上架
$conditions['is_show'] = array('eq', 0); //c端只显示可显示的楼盘
}
$conditions["latitude"] = array("between", array($second_spot_arr[0], $first_spot_arr[0]));
$conditions["longitude"] = array("between", array($second_spot_arr[1], $first_spot_arr[1]));
......@@ -91,7 +96,13 @@ class MapFindHouse extends Basic
$disc_str .= $item["name"] . ",";
}
$disc_str = rtrim($disc_str, ",");
$shop_arr = $this->gHousesModel->getHouseNumByDisc($disc_str);
$where_["a.disc"] = array("in",$disc_str);
if($params["source"] == 2){
$where_['a.status'] = array('eq', 1); //只显示上架
$where_['a.is_show'] = array('eq', 0); //c端只显示可显示的楼盘
}
$shop_arr = $this->gHousesModel->getHouseNumByDisc($where_);
$disc_arr = [];
foreach ($disc as $key => $item) {
foreach ($shop_arr as $i => $j) {
......@@ -105,7 +116,11 @@ class MapFindHouse extends Basic
$result = $disc_arr;
} elseif ($params["grade"] == 2) {
$businessModel = new GBusinessDistrict();
$result = $businessModel->getListByMap($params["city"]);
$str = " a.city = '".$params["city"]."' ";
if($params["source"] == 2){
$str .= " and b.status = 1 and b.is_show = 0";
}
$result = $businessModel->getListByMap($str);
}
return $this->response("200", "success", $result);
}
......
......@@ -41,7 +41,7 @@ class Site extends Basic
$field = 'id,name,city,is_del';
$get_params['is_del'] = 0;
$res = $this->aSite->getSite($field, $params);
$res = $this->aSite->getSite($field, $get_params);
return $this->response("200", "成功", $res);
}
......
......@@ -60,6 +60,8 @@ class Basic extends Controller
"broker/addUserCallAgentV2",
"broker/addSpreadUser",
"broker/getVolume",
"broker/getCityInfoByMap",
"broker/getShopListByMap",
);
/**
......
......@@ -272,7 +272,7 @@ class PushMessageService
if (!empty($device_id_array)) {
foreach ($device_id_array as $k => $v) {
if (!empty($v['push_id'])) {
$result[] = $this->push->public_push_message_for_one($id, $v['push_id'], $title, $content, $type, $user_id, $house_id, $order_id);
$result[] = $this->push->public_push_message_for_one($id, $v['push_id'], $title, $content, $type, $user_id, $house_id, $order_id, $title);
}
}
}
......
......@@ -58,6 +58,11 @@
</ul>
</div>
<!--line 3-->
<!--最适合业态-->
<p class="b3_font1 b3_span_shop_yetai">
<span>最适合业态:</span>
<span class="b3_span_shop_yetai_con gw"></span>
</p>
<p class="b3_font1 b3_span_shop_num">
<span>剩余铺数:</span>
<span class="b3_span_build_num gw"></span>
......
......@@ -86,7 +86,7 @@ class ChatService
//todo 保存或更新push_id
//todo 1.判断设备id +id 的数据是否存在,存在并且push_id和提交的不同则修改,否者新增
if ($id > 0 && $device_id && $push_id) {
$this->savePushIdV2($id, $device_id, $push_id, $chatUser[0]['type']);
$this->savePushIdV2($id, $device_id, $push_id, $source);
}
return [ "code" => 200, "only_id" => $only_id ];
}
......@@ -151,12 +151,19 @@ class ChatService
private function savePushIdV2($chat_user_id, $device_id, $push_id, $type)
{
//todo 根据设备来判断使用设备用户,
$where['ext_id'] = $chat_user_id;
$where['push_id'] = $push_id;
$where['device_id'] = $device_id;
$where['type'] = $type;
$info = $this->chatUserExtModel->getChatUserExtByUserId($where, 'a.id,a.ext_id,a.device_id,a.push_id,a.is_forbidden', 100);
$result = false;
if (count($info) > 0) {
$where['device_id'] = $device_id;
$where['type'] = $type;
$where['ext_id'] = ['<>', $chat_user_id];
$info = $this->chatUserExtModel->getChatUserExtByUserId($where, 'a.id,a.ext_id,a.device_id,a.push_id,a.is_forbidden', 100);
$current_user_id = 0;
foreach ($info as $k=>$v) {
if ($v['is_forbidden'] == 0) {
......
......@@ -59,6 +59,11 @@
</ul>
</div>
<!--line 3-->
<!--最适合业态-->
<p class="b3_font1 b3_span_shop_yetai">
<span>最适合业态:</span>
<span class="b3_span_shop_yetai_con gw"></span>
</p>
<p class="b3_font1 b3_span_shop_num">
<span>剩余铺数:</span>
<span class="b3_span_build_num gw"></span>
......
......@@ -34,10 +34,10 @@ class GBusinessDistrict extends BaseModel
return $result;
}
public function getListByMap($city){
public function getListByMap($params){
$sql = "select a.id,a.`name`,a.longitude,a.latitude,count(b.id) as num
from g_business_district as a left join g_houses as b on b.business_district_id=a.id
where a.city='".$city."' and a.longitude <> '' GROUP BY b.business_district_id HAVING num > 0";
where $params and a.longitude <> '' GROUP BY b.business_district_id HAVING num > 0";
return $this->query($sql);
}
......
......@@ -1598,14 +1598,13 @@ class GHouses extends BaseModel
}
/**
* @param $disc_str
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getHouseNumByDisc($disc_str){
$params["a.disc"] = array("in",$disc_str);
public function getHouseNumByDisc($params){
$result = Db::table($this->table)
->field("a.id,a.disc,count(1) as num")
->alias("a")
......
......@@ -11,13 +11,14 @@ namespace app\model;
use think\Db;
class OPushMessageModel
class OPushMessageModel extends BaseModel
{
protected $table = "u_push_message";
private $db_;
public function __construct()
public function __construct($data = [])
{
parent::__construct($data);
$this->db_ = Db::name($this->table);
}
......
......@@ -423,6 +423,7 @@ Route::group('api', [
//post AppointmentTime
'getAppointmentSeeShopList' => ['api/appointmentTime/getAppointmentSeeShopList', ['method' => 'post|get']],
'addAppointmentSeeShop' => ['api/appointmentTime/addAppointmentSeeShop', ['method' => 'post|get']],
'checkAppointment' => ['api/appointmentTime/checkAppointment', ['method' => 'get']],
//tradeLog
......
......@@ -23,4 +23,4 @@
if(!doc.addEventListener) return;
win.addEventListener(resizeEvt, recalc, false);
doc.addEventListener('DOMContentLoaded', recalc, false);
})(document, window);</script><link href=./static/css/app.7ee3b57e69b432b0911a83c779e43db0.css rel=stylesheet></head><body><div id=app></div><script src=https://api.tonglianjituan.com/app/js/libs/vue.min.js></script><script src=https://api.tonglianjituan.com/app/js/libs/vue-router.min.js></script><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.74698e64579a16bcf167.js></script><script type=text/javascript src=./static/js/app.b6b55d4b5452c168829d.js></script></body></html>
\ No newline at end of file
})(document, window);</script><link href=./static/css/app.12344a9c35bd0edb3041ec77de794ca3.css rel=stylesheet></head><body><div id=app></div><script src=https://api.tonglianjituan.com/app/js/libs/vue.min.js></script><script src=https://api.tonglianjituan.com/app/js/libs/vue-router.min.js></script><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.74698e64579a16bcf167.js></script><script type=text/javascript src=./static/js/app.c6a55585eae0ec40fcb7.js></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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