Commit 3ce64ee7 authored by clone's avatar clone

Merge branch '0830-v2.9.0' into test

# Conflicts: # application/api_broker/service/UploadFileService.php # application/chat/controller/AppChat.php # application/model/AAgents.php # application/route.php # public/resource/js/pictureShow.js
parents 56cd8bcf 2f3e34a2
......@@ -14,6 +14,7 @@ use app\api_broker\service\LookShopService;
use app\model\AttentionModel;
use app\model\GHouses;
use app\model\GHousesImgs;
use app\model\GImageDepot;
use app\model\GLabels;
use app\model\HouseImgs;
use app\model\HouseInfos;
......@@ -32,6 +33,7 @@ class Shop extends Basic
private $gHousesModel;
private $gHousesImgModel;
private $lookShopService_;
private $imageDepotModel;
function __construct($request = null)
{
......@@ -43,6 +45,7 @@ class Shop extends Basic
$this->gHousesModel = new GHouses();
$this->gHousesImgModel = new GHousesImgs();
$this->lookShopService_ = new LookShopService();
$this->imageDepotModel = new GImageDepot();
}
......@@ -87,7 +90,7 @@ 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
$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";
$conditions["city"] = trim($params['city']);
......@@ -181,13 +184,19 @@ class Shop extends Basic
//获取图片信息
foreach ($result as $key => $val) {
$result[$key]["api_path"] = CK_IMG_URL . 'images/';
$result[$key]["api_path"] = SHOP_IMAGE_DEPOT_URL ;
$result[$key]["rent_price"] = $val["rent_price"] * 0.01;
$result[$key]["title"] = $val["disc"] . $result[$key]["title"];
$result[$key]["images"] = [];
if ($val["external_image_id"]) {
$param["id"] = array( "in", $val["external_image_id"] );
$param["img_status"] = 0;
$field = 'id,0 as house_id,img_type,label,img_name,img_status';
$res = $this->imageDepotModel->getImageDepotById($field, $param,1);
$result[$key]["images"] = count($res) > 0 ? $res : [];
}
$param["house_id"] = $val["id"];
$param["img_type"] = 1; //默认主图
$result[$key]["images"] = $this->gHousesImgModel->getHouseImages($param, 1);
}
......@@ -209,12 +218,13 @@ class Shop extends Basic
public function getShopDetail()
{
header('Access-Control-Allow-Origin:*');
/* $params = array(
"id" => 3084,
$params = $this->params;
/* $params = array(
"id" => 7407,
"site_area" => 3, //1.c端 3.b端 4.pc端
//"user_id" => 2 //if c端 用户登录后传入user_id
);*/
$params = $this->params;
$conditions = [];
if (empty($params['id'])) {
......@@ -224,12 +234,12 @@ class Shop extends Basic
return $this->response("101", "请求来源错误");
}
$field = "a.id,a.external_title as title,a.external_address as address,a.city,a.disc,a.business_district_id,a.status,
$field = "a.id,a.external_title as title,a.external_address as address,a.city,a.disc,a.business_district_id,a.status,a.external_image_id,
a.industry_type,a.shop_area_start,a.shop_area_end,a.shop_type,a.residue_num,a.shop_sign,a.is_carefully_chosen,a.rent_type,
a.rent_price,a.management_fee,a.slotting_fee,a.total,a.market_area,a.is_has_gas,a.file_path,a.longitude,a.latitude,
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.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";
$conditions['a.status'] = array( "eq", 1 );
$conditions['a.is_show'] = array( 'eq', 0 ); //c端只显示公开楼盘
......@@ -257,13 +267,22 @@ class Shop extends Basic
if ($result["external_slotting_fee"] != '-1') {
$result["external_slotting_fee"] = $result["external_slotting_fee"] * 0.01;
}
$result["api_path"] = CK_IMG_URL . 'images/';
$param["house_id"] = $params['id'];
$result["api_path"] = SHOP_IMAGE_DEPOT_URL;
//$param["house_id"] = $params['id'];
//todo 这里的是否要更改成b端后台上传的类型
$param["img_type"] = 2;
$result["images"] = $this->gHousesImgModel->getHouseImages($param, 15);
$param["img_type"] = 3;//图片类型:1效果图,2实景图,3样板图,4户型图,5交通图
$result["plan_images"] = $this->gHousesImgModel->getHouseImages($param, 1);
/* $param["img_type"] = 2;
$result["images"] = $this->gHousesImgModel->getHouseImages($param, 15);
$param["img_type"] = 3;//图片类型:1效果图,2实景图,3样板图,4户型图,5交通图
$result["plan_images"] = $this->gHousesImgModel->getHouseImages($param, 1);*/
$result["images"] = [];
if ($result["external_image_id"]) {
$param["id"] = array( "in", $result["external_image_id"] );
$param["img_status"] = 0;
$field = 'id,0 as house_id,img_type,label,img_name,img_status';
$res = $this->imageDepotModel->getImageDepotById($field, $param);
$result["images"] = count($res) > 0 ? $res : [];
}
if ($result['status'] == 0) {
return $this->response("101", '此楼盘已下架');
......@@ -297,7 +316,7 @@ class Shop extends Basic
$regions = new Regions();
$cityList = $regions->getRegionsCitySH($city_code);
$i = 0;
$i = $j = 0;
$result["area"][$i]["city"] = "全部";
$result["area"][$i]["disc"][] = "全部";
foreach ($cityList as $k => $v) {
......@@ -311,10 +330,25 @@ class Shop extends Basic
$result["area"][$i]["disc"][] = $item;
}
}
if ($j == 0) {
$result["area"][$i]["business_district"][$j]['district'] = "全" . $v["name"];
$result["area"][$i]["business_district"][$j]['business'][] = [
'id'=>0,'name'=>'全部'
];
}
foreach ($v['business_district'] as $item2) {
if (!empty($item2)) {
$j++;
$result["area"][$i]["business_district"][$j] = $item2;
}
}
break; //目前只有上海和杭州其余的先不显示
}
$result['yetai'] = array( '全部', '餐饮美食', '百货零售', '服装', '亲子教育', '休闲娱乐', '办公', '其他' );
$result['yetai'] = array( '全部', '商场美食', '沿街餐饮', '百货超市', '服饰鞋包', '亲子教育', '休闲娱乐', '办公', '其他' );
//租金租金(0:租金-大于三万; 1:租金一万到三万之间; 2:租金-小于一万)
$result['money'] = array( array( 'id' => '-1', 'value' => '全部' ), array( 'id' => '0', 'value' => '3万以上' ),
......
......@@ -103,7 +103,7 @@ class Basic extends Controller
$this->timeStamp_ = $result->timeStamp_;
}
//$this->getCity($this->userId);
$this->getCity($this->userId);
$requestPath = $this->request->routeInfo()["rule"][0] . "/" . $this->request->routeInfo()["rule"][1];
//过滤掉不需要验证token的接口
......
......@@ -258,8 +258,15 @@ class Broker extends Basic
}
if ($where) {
$field = 'id,name,phone';
$field = 'id,name,phone,img';
$data['data'] = $this->a_agents->getList($pageNo, $pageSize, 'id DESC', $field, '', $where);
if($data['data']){
foreach ($data['data'] as $k=>$v) {
if (isset($v['img'])) {
$data['data'][$k]['head_portrait'] = AGENTHEADERIMGURL . $v['img'];
}
}
}
} else {
$data['msg'] = '没有经纪人信息';
}
......
......@@ -11,6 +11,7 @@ use app\index\validate\HouseValidate;
use app\model\AAgents;
use app\model\ACollectHouse;
use app\model\AttentionModel;
use app\model\GBusinessDistrict;
use app\model\GHouses;
use app\model\GHousesExt;
use app\model\GHousesFollowUp;
......@@ -56,28 +57,29 @@ class Shop extends Basic
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/* $params = array(
"site_area" => 4, //来源 1c首页 2c搜索 3b首页 4b搜索 5b报备
// "title" => "vv", //1,2 external_title ,3,4internal_title
"house_id" => 4,
"is_carefully_chosen" => 0, //精选商铺--0否1是
"shop_type" => 0, //商铺类型(0商场,1街铺)
"address" => "111",
"disc" => "黄浦区",
"industry_type" => "休闲娱乐",
"shop_area_start" => 45,//面积起始范围 街铺start和end面积一样
"shop_area_end" => 65,//面积结束范围
"rent_price_start" => 1000,//租金 rent_price
"rent_price_end" => 10000,//租金
"shop_sign" => "临近地铁,临近地铁2",
"agent_id" => 630, //添加经纪人id
"status" => 1, //1上架or2下架
"start_time" => "2018-05-25",
"end_time" => "2018-05-30",
"landlord_phone" => "17621970093",
"pageNo" => 1,
"pageSize" => 15
);*/
/* $params = array(
"site_area" => 4, //来源 1c首页 2c搜索 3b首页 4b搜索 5b报备
// "title" => "vv", //1,2 external_title ,3,4internal_title
"house_id" => 4,
"is_carefully_chosen" => 0, //精选商铺--0否1是
"shop_type" => 0, //商铺类型(0商场,1街铺)
"address" => "111",
"disc" => "黄浦区",
"business_id" => 11,
"industry_type" => "休闲娱乐",
"shop_area_start" => 45,//面积起始范围 街铺start和end面积一样
"shop_area_end" => 65,//面积结束范围
"rent_price_start" => 1000,//租金 rent_price
"rent_price_end" => 10000,//租金
"shop_sign" => "临近地铁,临近地铁2",
"agent_id" => 630, //添加经纪人id
"status" => 1, //1上架or2下架
"start_time" => "2018-05-25",
"end_time" => "2018-05-30",
"landlord_phone" => "17621970093",
"pageNo" => 1,
"pageSize" => 15
);*/
$conditions = [];
if (empty($params['site_area'])) {
return $this->response("101", "请求来源不能为空");
......@@ -149,6 +151,9 @@ class Shop extends Basic
if (isset($params['disc'])) { //区域
$conditions['disc'] = array( 'eq', trim($params['disc']) );
}
if (isset($params['business_id'])) { //商圈
$conditions['business_district_id'] = array( 'eq', trim($params['business_id']) );
}
if (isset($params['industry_type'])) { //业态
$conditions['industry_type'] = array( 'like', "%" . trim($params['industry_type']) . "%" );
......@@ -264,11 +269,11 @@ class Shop extends Basic
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/* $params = array(
"id" => 3084,
"site_area" => 3, //1.c端 3.b端 4.pc端
"user_id" => 2 //if c端 用户登录后传入user_id
);*/
/* $params = array(
"id" => 3084,
"site_area" => 3, //1.c端 3.b端 4.pc端
"user_id" => 2 //if c端 用户登录后传入user_id
);*/
$conditions = [];
if (empty($params['id'])) {
return $this->response("101", "详情id不能为空");
......@@ -278,15 +283,7 @@ class Shop extends Basic
}
if ($params['site_area'] == 1) {
$field = "a.id,a.external_title as title,a.external_address as address,a.city,a.disc,a.business_district_id,a.status,
a.industry_type,a.shop_area_start,a.shop_area_end,a.shop_type,a.residue_num,a.shop_sign,a.is_carefully_chosen,a.rent_type,
a.rent_price,a.management_fee,a.slotting_fee,a.total,a.market_area,a.is_has_gas,a.file_path,a.longitude,a.latitude,
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";
$conditions['a.status'] = array( "eq", 1 );
$conditions['a.is_show'] = array( 'eq', 0 ); //c端只显示公开楼盘
} else if ($params['site_area'] == 3) {
if ($params['site_area'] == 3) {
$field = "a.id,a.internal_title as title,a.internal_address as address,a.city,a.disc,a.business_district_id,a.status,
a.industry_type,a.shop_area_start,a.shop_area_end,a.shop_type,a.residue_num,a.shop_sign,a.is_carefully_chosen,a.rent_type,
a.rent_price,a.management_fee,a.slotting_fee,a.total,a.market_area,a.is_has_gas,a.file_path,a.longitude,a.latitude,
......@@ -307,7 +304,8 @@ class Shop extends Basic
$conditions['a.id'] = array( "eq", $params["id"] );
$field .= ',b.age_limit,b.payment_month,b.deposit_month,b.external_slotting_fee,c.agents_id';
$field .= ',b.age_limit,b.payment_month,b.deposit_month,b.external_slotting_fee,c.agents_id, b.area_width,b.depth,
b.electric_quantity,b.voltage,b.exhaust_fume,b.running_water,b.downriver,b.business_scope,b.decoration,b.source';
$result = $this->gHousesModel->getHouseDetailById($field, $conditions);
if (count($result) <= 0) {
return $this->response("101", '此楼盘不存在');
......@@ -414,8 +412,8 @@ class Shop extends Basic
$result["is_collect"] = 1;
}
$vip_services = new VipService();
$result['is_can_edit'] = $vip_services->vip($params['user_id'],'index/houseEdit');
$vip_services = new VipService();
$result['is_can_edit'] = $vip_services->vip($params['user_id'], 'index/houseEdit');
}
$result['new_sign_rule'] = "付{$result['payment_month']}{$result['deposit_month']},签订{$result['age_limit']}年";
......@@ -432,7 +430,7 @@ class Shop extends Basic
*/
public function edit()
{
return $this->response(101,'请升级最新版本');
return $this->response(101, '请升级最新版本');
}
/**
......@@ -465,12 +463,7 @@ class Shop extends Basic
if ($house_id) {
$result['data']['house_id'] = $house_id['house_id'];
$result['data']['internal_title'] = empty($this->params['internal_title']) ? "" : $this->params['internal_title'];
$result['msg'] = '新增或编辑成功';
if (isset($house_id['status']) && $house_id['status'] == 2) {
$push_service = new PushMessageService();
$push_service->pushHouseDownMessage($house_id['house_id']);
}
$result['msg'] = '新增或编辑成功';
} else {
$data['code'] = 101;
$data['msg'] = 'Add houses failure';
......@@ -616,11 +609,11 @@ class Shop extends Basic
return $this->response("101", "请求参数错误");
}
$result = $this->gHousesModel->getHouseInfo('province,city,disc', [ 'id' => $params["house_id"]]);
if($result){
$result = $this->gHousesModel->getHouseInfo('province,city,disc', [ 'id' => $params["house_id"] ]);
if ($result) {
$params['province'] = $result[0]['province'] ? $result[0]['province'] : '上海市';
$params['city'] = $result[0]['city']? $result[0]['city'] : '上海市';
$params['disc'] = $result[0]['disc']? $result[0]['disc'] : '黄浦区';
$params['city'] = $result[0]['city'] ? $result[0]['city'] : '上海市';
$params['disc'] = $result[0]['disc'] ? $result[0]['disc'] : '黄浦区';
}
$follow_up_model = new GHousesFollowUp();
......@@ -633,4 +626,48 @@ class Shop extends Basic
}
/**
* 获取全部商圈列表
*
* @return \think\Response
*/
public function getBusinessAll()
{
$code = 200;
$msg = '';
$where['is_del'] = 0;
if ($this->params['name'] != NULL) {
$where['name'] = [ 'LIKE', '%' . $this->params['name'] . '%' ];
}
if (!empty($this->params['province'])) {
$where['province'] = $this->params['province'];
}
if (empty($this->params['city'])) {
$where['city'] = '上海市';
} else {
$where['city'] = $this->params['city'];
}
if (!empty($this->params['disc'])) {
$where['disc'] = $this->params['disc'];
}
$fields = 'id,name,province,city,disc,status,create_time';
try {
$auth_group = New GBusinessDistrict();
$data = $auth_group->getList(1, 1000, 'id desc', $fields, $where);
} catch (\Exception $e) {
$code = 101;
$msg = $e->getMessage();
$data = [];
}
return $this->response($code, $msg, $data);
}
}
......@@ -7,6 +7,7 @@ use app\api_broker\service\StatementService;
use app\model\RAgentNote;
use app\model\RAgentReport;
use think\Exception;
use think\Log;
use think\Request;
/**
......@@ -40,6 +41,7 @@ class Statement extends Basic
"time_start" => date("Y-m-d", time()),
"time_end" => date("Y-m-d", time()),
);*/
Log::write(json_encode($params), '本月完成单数-传入条件44行-7151'); //记录日志
if (!isset($params["agent_id"]) || !isset($params["time_start"]) || !isset($params["time_end"])) {
return $this->response("101", "请求参数错误");
......
......@@ -55,7 +55,8 @@ class Basic extends Controller
'broker/editDecFeedClick',
'broker/sendSms',
'broker/getNewsInfo',
'broker/getComment'
'broker/getComment',
'broker/getBusinessAll'
);
/**
......
......@@ -472,8 +472,8 @@ class OrderLogService
}
//审核流程
$field_financial = "id,bargain_id,agent_id,source,status,remark,audit_level,audit_id,audit_name,create_time,update_time";
$oFinancialData = $oFinancialModel->selectFinancialByOrderNo($field_financial, [ "order_id" => $order_id ]);
$field_financial = "id,bargain_id,agent_id,source,status,remark,audit_level,audit_id,audit_name,create_time,update_time";
$oFinancialData = $oFinancialModel->selectFinancialByOrderNo($field_financial, [ "order_id" => $order_id ]);
if (count($oFinancialData) > 0) {
foreach ($oFinancialData as $k => $v) {
$v["step_name"] = "financial";
......@@ -588,8 +588,8 @@ class OrderLogService
}
//审核流程
$field_financial = "id,bargain_id,agent_id,source,status,remark,audit_level,audit_id,audit_name,create_time,update_time";
$oFinancialData = $oFinancialModel->selectFinancialByOrderNo($field_financial, [ "order_id" => $order_id ]);
$field_financial = "id,bargain_id,agent_id,source,status,remark,audit_level,audit_id,audit_name,create_time,update_time";
$oFinancialData = $oFinancialModel->selectFinancialByOrderNo($field_financial, [ "order_id" => $order_id ]);
if (count($oFinancialData) > 0) {
foreach ($oFinancialData as $k => $v) {
$v["step_name"] = "financial";
......@@ -1173,7 +1173,7 @@ class OrderLogService
if (count($params) == 0) {
return $cent_commissions;
} else {
$item = $params[0];
$item = $params[0];
$role = !empty($params[0]["role"]) ? $params[0]["role"] : $params[0]["roles"];
$cent_commission["id"] = $item["id"];
......@@ -1227,7 +1227,8 @@ class OrderLogService
$bargainModel = new OBargainModel();
$bargain_info_filed = "a.id,a.house_number,a.account_time,a.account_statement,a.father_id,a.is_open,a.trade_type,
a.price,a.industry_type,a.estimated_receipt_date,a.commission,c.id as house_id,c.internal_title,c.internal_address,d.user_id,d.user_phone,d.user_name";
a.price,a.industry_type,a.estimated_receipt_date,a.commission,c.id as house_id,c.internal_title,c.internal_address,
d.user_id,d.user_phone,d.user_name";
$result = [];
$bargainInfo = $bargainModel->selectBargainDetail($bargain_info_filed, $params);
......@@ -1240,14 +1241,15 @@ class OrderLogService
$realIncomeModel = new ORealIncome();
$realIncomeArr = $realIncomeModel->getBargainTaxes($params["bargain_id"]);
$bargainInfo[0]["realIncome"] = $realIncomeArr;
$bargainInfo[0]["user_phone"] = substr_replace($bargainInfo[0]["user_phone"], '****', 3, 4);
$result["bargainInfo"] = $bargainInfo[0];
$bargain_id = $bargainInfo[0]["father_id"] == 0 ? $bargainInfo[0]["id"] : $bargainInfo[0]["father_id"];
//分佣提成 o_partial_commission
$field_commission = "a.id,a.agent_id,a.role as roles,a.scale as scales,a.scale_fee,b.role,c.name,c.phone,b.scale,b.should_commission,b.confirm_date,b.create_time,b.real_fee,b.charity_fund,
b.cash,b.practical_fee,b.service_charge";
$field_commission = "a.id,a.agent_id,a.role as roles,a.scale as scales,a.scale_fee,b.role,c.name,c.phone,b.scale,
b.should_commission,b.confirm_date,b.create_time,b.real_fee,b.charity_fund,b.cash,b.practical_fee,b.service_charge";
$cent_commission_arr = $bargainModel->selectBargainCommission($field_commission, [ "bargain_id" => $bargain_id ]);
//dump($cent_commission_arr);
......
......@@ -51,7 +51,6 @@ class PushMessageService
$house_data = $house->getHouseDetail('internal_title', [ 'id' => $house_id ]);
foreach ($data as $k => $v) {
$content = "【{$agent_name['store_name']}】店【{$agent_name['name']}】约带看【{$house_data['internal_title']}】商铺";
// $this->push->public_push_message_for_one($v['id'], $v['device_id'], '报备', $content);
$this->pushAgentAllDeviceId($v['id'], '报备', $content);
}
return;
......@@ -73,8 +72,7 @@ class PushMessageService
$field = 'house_title,user_name,report_store_id,report_agent_id';
$report_data = $report->getReportOrder($field, [ 'a.id' => $report_id ]);
$agent = new AAgents();
// $agent_data = $agent->getAgentInfo('id', $report_data['report_agent_id']);
$agent = new AAgents();
if ($type == 1) {
$content = "客户{$report_data['user_name']}进场【{$report_data['house_title']}】商铺";
......@@ -85,12 +83,9 @@ class PushMessageService
}
$where['store_id'] = $report_data['report_store_id'];
$where['level'] = ['in', '20,40'];
$where['level'] = [ 'in', '20,40' ];
$agent_store = $agent->getAgentInfo('id', '', $where);
// $this->push->public_push_message_for_one($report_data['report_agent_id'], $agent_data['device_id'], $title, $content);
// $this->push->public_push_message_for_one($agent_store['id'], $agent_store['device_id'], $title, $content);
$this->pushAgentAllDeviceId($report_data['report_agent_id'], $title, $content);
$this->pushAgentAllDeviceId($agent_store['id'], $title, $content);
return;
......@@ -188,11 +183,6 @@ class PushMessageService
if (empty($id)) {
return false;
}
$result = [];
// $agent = new AAgents();
// $device_id = $agent->getAgentsById($id, 'device_id');
// $result = $this->push->public_push_message_for_one($id, $device_id, $title, $content, $type, $user_id);
$result = $this->pushAgentAllDeviceId($id, $title, $content, $type, $user_id);
return $result;
......@@ -217,66 +207,16 @@ class PushMessageService
$agent_data = $agent->getAgentInfo('id,name', $agent_id);
$content = "{$submit_agent_name}新增成交报告,分佣方:{$agent_data['name']}[{$house['internal_title']}]商铺";
// return $this->push->public_push_message_for_one($agent_data['id'], $agent_data['device_id'], '新增分佣', $content);
return $this->pushAgentAllDeviceId($agent_data['id'], '新增分佣', $content);
}
/**
* @param $house_id
* @param $operation_id
* @param $agent_id
* @param $push_str
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function pushHouseMessage($house_id, $operation_id, $agent_id, $push_str) {
$agent = new AAgents();
$ccr_agent_data = $agent->getAgentInfo('name,phone', $operation_id);
$house = new GHouses();
$house_data = $house->getHouseInfoById('internal_title',['id'=>$house_id]);
$content = '你的【'.$house_data['internal_title'].'】商铺,盘方被【'.$ccr_agent_data['name'].'-'.$ccr_agent_data['phone'].'】修改为'.$push_str;
foreach ($agent_id as $k=>$v) {
$this->pushAgentAllDeviceId($v, '修改盘方', $content, 'house_info',$house_id);
}
return ;
}
/**
* 根据商铺id 推送下架消息
*
* @param $house_id
* @return bool|void
*/
public function pushHouseDownMessage($house_id) {
$house = new GHouses();
try {
$house_data = $house->getHouseInfoById('internal_title',['id'=>$house_id]);
$content = '你的【'.$house_data['internal_title'].'】商铺下架,如需要上架,请编辑提交该商铺';
$house_agent = new GHousesToAgents();
$house_agent_data = $house_agent->getAgentList($house_id, 2, 'a.agents_id');
} catch (\Exception $e) {
return false;
}
foreach ($house_agent_data as $k=>$v) {
$this->pushAgentAllDeviceId($v['agents_id'], '商铺下架', $content, 'house_info',$house_id);
}
return ;
}
/**
* @param $id
* @param $title
* @param $content
* @param null $type
* @param null $user_id
* @return bool
* @return array|bool
*/
public function pushAgentAllDeviceId($id, $title, $content, $type = null, $user_id = null)
{
......@@ -285,23 +225,24 @@ class PushMessageService
}
$m_agent_device = new ABindingDevice();
$device_id_array = $m_agent_device->getDeviceByAgentId([ 'agent_id' => $id, 'is_forbidden'=>0], 'id,push_id');
$device_id_array = $m_agent_device->getDeviceByAgentId([ 'agent_id' => $id, 'is_forbidden' => 0 ], 'id,push_id');
$result = [];
if (!empty($device_id_array)) {
foreach ($device_id_array as $k => $v) {
if (!empty($v['push_id'])) {
$this->push->public_push_message_for_one($id, $v['push_id'], $title, $content, $type, $user_id);
$result[] = $this->push->public_push_message_for_one($id, $v['push_id'], $title, $content, $type, $user_id);
}
}
}
return true;
return $result;
}
/**
* @return bool
*/
public function pushAllow() {
public function pushAllow()
{
$url = $this->push->http_host();
if ($url == 'http://api.tonglianjituan.com' || $url == 'https://api.tonglianjituan.com') {
return true;
......@@ -319,17 +260,61 @@ class PushMessageService
* @param $data
* @return bool
*/
public function record($type, $house_id, $agent_id, $operation_id, $data = []) {
public function record($type, $house_id, $agent_id, $operation_id, $data = [])
{
$result = false;
$m_push = new MPushMessage();
switch ($type) {
case 0 :
$result = $m_push->addData( $data, $operation_id, $type);break;
$result = $m_push->addData($data, $operation_id, $type);
break;
case 1 :
$result = $m_push->addHouseIdArray( $house_id, $operation_id, $type, $data);break;
$result = $m_push->addHouseIdArray($house_id, $operation_id, $type, $data);
break;
case 2 :
$result = $m_push->addAgentIdArray( $agent_id, $operation_id, $type, $data);break;
$data['house_id'] = $house_id;
$result = $m_push->addAgentIdArray($agent_id, $operation_id, $type, $data);
break;
}
return $result;
}
/**
*
*/
public function pushRecord()
{
$title = '';
$m_push = new MPushMessage();
$field = 'id,addressee_id,type,message,house_id';
$where['status'] = 0;
$push_data = $m_push->getDateLimit($field, $where, 100);
foreach ($push_data['data'] as $k => $v) {
if ($v['type'] == 0) {
// $this->pushBargainMessage();
} else {
switch ($v['type']) {
case 1 :
$title = "商铺下架";
break;
case 2:
$title = "修改客方";
break;
case 3:
$title = '盘方修改';
break;
}
$result = $this->pushAgentAllDeviceId($v['addressee_id'], $title, $v['message'], 'house_info', $v['house_id']);
$update_data['status'] = 1;
$update_data['send_time'] = date('Y-m-d H:i:s');
$m_push->updateData($update_data, [ 'id' => $v['id'] ]);
}
}
return;
}
}
\ No newline at end of file
......@@ -263,7 +263,7 @@ class StatementService
$where_['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
$performanceSum = $obargain->getAddBargainNum($where_, 3);//1表示业绩 2表示实收
$performanceSum = $obargain->getAddBargainNumV2($where_, 3);//1表示业绩 2表示实收
$result["director_bargain_sum_store"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
} else {//周报
......@@ -311,7 +311,7 @@ class StatementService
$where_['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
$performanceSum = $obargain->getAddBargainNum($where_, 3);//1表示业绩 2表示实收
$performanceSum = $obargain->getAddBargainNumV2($where_, 3);//1表示业绩 2表示实收
$result["director_bargain_sum_store"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
//todo 上周人数
$start_time = date("Y-m-d", strtotime("-14 day"));
......@@ -463,7 +463,7 @@ class StatementService
$where_["agent_id"] = array( "in", $agentIds );
$where_['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
$performanceSum = $obargain->getAddBargainNum($where_, 3);//1表示业绩 2表示实收
$performanceSum = $obargain->getAddBargainNumV2($where_, 3);//1表示业绩 2表示实收
$results[$key]["director_bargain_sum_store"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
//todo 上周人数
$start_time = date("Y-m-d", strtotime("-14 day"));
......
......@@ -82,6 +82,10 @@ class UploadFileService
$path .= 'static/shop_image_depot/';
$internet_path = 'static/shop_image_depot/';
break;
case 'exclusive_file' :
$path .= 'static/exclusive_file/';
$internet_path = 'static/exclusive_file/';
break;
default :
$data['code'] = 101;
$data['msg'] = "上传图片类型错误";
......
......@@ -24,33 +24,11 @@
<span class="lp-bunner-page"> <span class="lp-index"> 1 </span> / <span class="lp-sum"> 50 </span> </span>
</div>
</header>
<!--line 1-->
<div class="line_a">
<!--<p class="a_fonta">
恒大国际广场
</p>-->
<!--<p class="a_fontb">
20000-25000元/月(月租金)
</p>
<span class="a_fontc">
物业管理费:2000元/月
</span>
<span class="a_fontd">
进场费:200000元
</span>-->
</div>
<div class="line_a_ul">
<ul class="line_a_ulul">
<!--<li>
随时看房
</li>
<li>
繁华看房
</li>
<li>
随时看房
</li>-->
</ul>
</div>
<p class="b3_font1" id="font_24">
......@@ -59,34 +37,19 @@
</p>
<p class="line_hr"></p>
<!--line 2-->
<div class="line_b">
<ul>
<li class="ul_b1">
<span class="b1_span_ pu_area_type">
商铺面积
</span>
<span class="b1_span_totl pu_area">
</span>
<span class="b1_span_ pu_area_type">商铺面积</span>
<span class="b1_span_totl pu_area"></span>
</li>
<li class="ul_b2">
<span class="b1_span_ pu_price_type">
租金
</span>
<span class="b1_span_totl pu_price">
</span>
<span class="b1_span_ pu_price_type">租金</span>
<span class="b1_span_totl pu_price"></span>
</li>
<li class="ul_b3">
<span class="b1_span_ slotting_fee_type">
转让费
</span>
<span class="b1_span_totl slotting_fee">
</span>
<span class="b1_span_ slotting_fee_type">转让费</span>
<span class="b1_span_totl slotting_fee"></span>
</li>
</ul>
</div>
......@@ -113,29 +76,24 @@
<span class="b3_span2 gw"></span>
</p>
<p class="b3_font1">
已入驻:
已入驻:
<span class="b3_span3 gw"></span>
</p>
<!--<span class="b3_font3 dt">
已入驻:
</span>
<span class="b3_span3 gw dt"></span>-->
<p class="line_hr"></p>
<!--line 4-->
<div class="b4_font">
<p class="b4_font_p">
项目优势
</p>
<p class="b4_font_p1 yw"></p>
</div>
</p>
<p class="line_hr"></p>
<!--line 5-->
<!--设施配套-->
<div class="b4_font">
<p class="b4_font_p">
签约规则
</p>
<p class="b5_font_p1 yw">
配套设施
</p>
<ul class="b4_font2 supporting-facilities">
<li><span class="icon-bg-facilities"><img src="/app/images/icon_200w@2x.png" class="supporting-facilities-img"/></span><span class="electric-quantity-details">200W</span></li>
<li><span class="icon-bg-facilities"><img src="/app/images/icon380v@2x.png" class="supporting-facilities-img"/></span><span class="voltage-details">380V</span></li>
<li class="meiqi-details-li"><span class="icon-bg-facilities"><img src="/app/images/icon_gas@2x.png" class="supporting-facilities-img"/></span><span class="meiqi">燃气</span></li>
<li class="exhaust-fume-details-li"><span class="icon-bg-facilities"><img src="/app/images/icon_piping@2x.png" class="supporting-facilities-img"/></span><span class="exhaust-fume-details">烟管道</span></li>
<li class="running-water-details-li"><span class="icon-bg-facilities"><img src="/app/images/icon_upper@2x.png" class="supporting-facilities-img"/></span><span class="running-water-details">上水</span></li>
<li class="downriver-details-li"><span class="icon-bg-facilities"><img src="/app/images/icon_sewer@2x.png" class="supporting-facilities-img"/></span><span class="downriver-details">下水</span></li>
</ul>
</div>
<p class="line_hr"></p>
<!--line 6-->
......@@ -147,55 +105,88 @@
营业时间:
<span class="b4_span1 gw yingye-time">
</span>
<span class="zhaoshang-time-p right">
</p>
<p class="b4_font2 zhaoshang-time-p">
<span class="zhaoshang-time-p">
招商时间:
<span class="b4_span1 gw zhaoshang-time">
</span>
</span>
</span>
<span class="kaiye-time-p right">
开业时间:
<span class="b4_span1 gw kaiye-time">
</span>
</span>
</p>
<!--面宽 进深 -->
<p class="b4_font2">
是否有燃气:
<span class="b4_span1 gw meiqi">
面宽:
<span class="b4_span1 gw area-width-details">
</span>
<span class="kaiye-time-p right">
开业时间:
<span class="b4_span1 gw kaiye-time">
<span class="right">
进深:
<span class="b4_span1 gw depth-details">
</span>
</span>
</p>
<p class="b4_font2">
目前证照经营范围:
<span class="b4_span1 gw business-scope-details">
</span>
</p>
<p class="b4_font2">
交付装修:
<span class="b4_span1 gw decoration-details">
</span>
</span>
</p>
<p class="b4_font2">
对内地址:
地址:
<span class="b4_span1 gw duinei">
</span>
</p>
<p class="b4_font2">
交通:
交通:
<span class="b4_span1 gw jiaotong">
</span>
</p>
</div>
<!--<div class="img_url" id="allmap">-->
<p class="line_hr"></p>
<!--line 4-->
<div class="b4_font">
<p class="b4_font_p">
经纪人对本铺评价
</p>
<p class="b4_font_p1 yw"></p>
</div>
<p class="line_hr"></p>
<!--line 5-->
<div class="b4_font">
<p class="b4_font_p">
签约规则
</p>
<p class="b5_font_p1 yw">
</p>
</div>
<!--</div>-->
<!--<p class="line_hr"></p>-->
<!--line 7-->
<div class="b4_font">
<p class="b4_font_p" id="planter">
楼盘平面
<!--<img src="/app/images/tonglian/but_right@2x.png" class="but_right">-->
</p>
</div>
<div class="slider3">
</div>
<p class="line_hr"></p>
<!--房源动态-->
<div class="b4_font">
<!--房源动态-->
<div class="b4_font">
<p class="b4_font_p">
房源动态
</p>
</div>
<div class="line_b">
<div class="line_b">
<ul>
<li class="ul_b1">
<span class="b1_span ">
......
......@@ -18,13 +18,51 @@
var vConsole = new VConsole();
}
</script>
<style>
.title-paddig{
padding : 0 1.76rem 0 0.88rem !important;
}
.icon-link-return {
right : 0.90rem !important;
}
.icon-link1 {
position: absolute;
top: 0;
bottom: 0;
right: .66rem;
display: block;
width: .88rem;
height: .88rem;
}
header .icon-link1.icon-link-edit{
background: url('/app/images/icon_bianji@2x.png') no-repeat center center/.38rem .38rem;
}
.icon-link2 {
position: absolute;
top: 0;
bottom: 0;
right: 0rem;
display: block;
width: .88rem;
height: .88rem;
}
header .icon-link2.icon-link-edit{
background: url('/app/images/icon_share@2x.png') no-repeat center center/.38rem .38rem;
}
</style>
</head>
<body>
<header id="header">
<a class="ps-back" href="javascript:(history.length>1?history.go(-1):window.location='/');" id="back_btn"></a>
<h2 id="title"></h2>
<a class="icon-link icon-link-edit" id="edit_btn"></a>
<h2 id="title" class="title-paddig"></h2>
<div class="btn-area">
<a class="icon-link1 icon-link-edit" id="edit_btn" style="float:right"></a>
<a class="icon-link2 icon-link-edit" id="return_btn" style="float:left"></a>
<!--<a class="icon-link111 icon-link-edit111" id="edit_btn111">123123</a>-->
<div>
</header>
<div class="header_seat"></div>
......
......@@ -26,7 +26,7 @@
<td>{{dealPrice}}</td>
<td>{{(d.shop_type==1)?'对内转让费':'进场费'}}:{{d.slotting_fee}}元</td>
<td>物业管理费:{{d.management_fee}}元/月</td>
<td></td>
<td>来源:{{switchSource(d.source)}}</td>
</tr>
<tr>
<td>{{(d.shop_type==1)?'使用面积':'商铺面积'}}:{{dealArea}}</td>
......@@ -56,7 +56,23 @@
<td>营业时间:{{d.do_business_date}}</td>
<td v-if="!d.shop_type">招商时间:{{d.opening_date}}</td>
<td v-if="!d.shop_type">开业时间:{{d.start_business_date}}</td>
<td>煤气:{{d.is_has_gas?'没有':'有'}}</td>
<!--<td>煤气:{{d.is_has_gas?'没有':'有'}}</td>-->
</tr>
<tr>
<td>面宽:{{d.area_width}}米</td>
<td>进深:{{d.depth}}米</td>
<td>电量:{{d.electric_quantity}}W</td>
<td>电压:{{d.voltage}}V</td>
</tr>
<tr>
<td>燃气:{{d.is_has_gas?'无':'有'}}</td>
<td>烟管道:{{d.exhaust_fume?'有':'无'}}</td>
<td>上水:{{d.running_water?'有':'无'}}</td>
<td>下水:{{d.downriver?'有':'无'}}</td>
</tr>
<tr>
<td colspan="2">目前证照经营范围:{{d.business_scope}}</td>
<td colspan="2">交付装修:{{switchDecoration(d.decoration)}}</td>
</tr>
<tr class="tr-seat">
<td colspan="4"></td>
......@@ -74,12 +90,12 @@
<tr class="tr-seat">
<td colspan="4"></td>
</tr>
<tr v-if="!(d.is_show==1)">
<td colspan="2">对外商铺名称:{{d.external_title}}</td>
<td colspan="2">对外商铺地址:{{d.province}}{{d.city+d.disc+d.external_address}}</td>
<tr>
<td colspan="2" v-if="!(d.is_show==1)">对外商铺名称:{{d.external_title}}</td>
<td colspan="2" v-if="!(d.is_show==1)">对外商铺地址:{{d.external_address}}</td>
</tr>
<tr v-if="!(d.is_show==1)">
<td colspan="2">对外项目优势:{{d.external_item_advantage}}</td>
<td colspan="2">经纪人对本铺的评价:{{d.external_item_advantage}}</td>
<td v-if="d.shop_type" colspan="2">对外转让费:{{(d.external_slotting_fee == '-1')?'面议':(d.external_slotting_fee+'元')}}</td>
<td v-else colspan="2"></td>
</tr>
......@@ -114,7 +130,7 @@
<div class="fl">盘方:</div>
<div class="fl">
<ul class="oh phone-list">
<li class="fl oh" v-for="(item, index) in d.panParty" :key="index" :data-id="item.id">{{item.name+'-'+item.phone}}</li>
<li class="fl oh" v-for="(item, index) in d.panParty" :key="index" :data-id="item.id">{{item.district_name+'-'+item.name+'-'+item.phone}}</li>
</ul>
</div>
</td>
......
......@@ -317,7 +317,7 @@ class AppChat extends Basic
if ($params["from"] == "C") {
$field = "id,external_title as title,shop_area_start,shop_area_end,rent_type,rent_price,shop_type";
} else {
$field = "id,external_title as title,shop_area_start,shop_area_end,rent_type,rent_price,shop_type";
$field = "id,internal_title as title,shop_area_start,shop_area_end,rent_type,rent_price,shop_type";
}
$result = $gHousesModel->getHouseInfoById($field, $conditions);
......@@ -409,9 +409,9 @@ class AppChat extends Basic
public function getUserInfoByFrom()
{
$params = $this->params;
$params = array(
/*$params = array(
'id' => 1,
);
);*/
if (!isset($params['id'])) {
return $this->response("300", "参数不全");
}
......@@ -428,10 +428,11 @@ class AppChat extends Basic
$result = $user->getAgentByUserId($field, $params_);
if (count($result) > 0) {
$result_["id"] = $result[0]["id"];
$result_["agent_id"] = 'agent_'.$result[0]["id"];
$result_["user_name"] = $result[0]["user_name"];
$result_["user_nick"] = $result[0]["user_nick"];
$result_["img"] = !empty($result[0]["user_pic"]) ? HEADERIMGURL . $result[0]["user_pic"] : $result[0]["other_pic"];
$result_["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $result[0]["user_phone"]);
$result_["user_pic"] = !empty($result[0]["user_pic"]) ? HEADERIMGURL . $result[0]["user_pic"] : $result[0]["other_pic"];
$result_["user_phone"] = $result[0]["user_phone"];
return $this->response("200", "success!", $result_);
} else {
......
......@@ -325,7 +325,7 @@ class ChatService
foreach ($agentsResult as $v) {
if ($v["user_pic"]) {
$v["user_pic"] = ADMIN_URL_TL . 'user_header/' . $v["user_pic"];
$v["user_pic"] = AGENTHEADERIMGURL . $v["user_pic"];
}
$v["only_id"] = $chat_user_arr [$v["user_phone"]];
......
......@@ -19,7 +19,7 @@ class ChatVerifyValidate extends Validate
* $target = $params['target']; //接受人 if target_type 群 者表示群id
* $source = $params['source']; //消息来源 1c端app 2b端app 3其他
* $is_user = $params['is_user']; //发送人是否是会员 0是1经济人
* $type = $params['type']; //消息类型 1文字 2图片 3楼盘
* $type = $params['type']; //消息类型 1文字 2图片 3楼盘 4经纪人
* $msg_content = $params['msg_content'];
* $from = $params['from']; //消息发送人
* @var array
......@@ -29,7 +29,7 @@ class ChatVerifyValidate extends Validate
'target' => 'require',
'source' => 'require|in:1,2,3',
'is_user' => 'require|in:0,1',
'type' => 'require|in:1,2,3',
'type' => 'require|in:1,2,3,4',
'msg_content' => 'require',
'from' => 'require',
];
......
......@@ -23,6 +23,8 @@ define('_POOLKEY','FC100000022056027');//隐私号码
define('_TLSYPoolKey','FC100000022056027');//隐私号码池
define('WEEK_WORK_IMG', CURRENT_URL . 'static'. DS . 'week_work_img/'); //周报日报目录
define('PHONE_VOICE', ROOT_PATH.'public'.DS.'static'.DS.'voice'); //录音绝对路径
define('SHOP_IMAGE_DEPOT_URL', CURRENT_URL . 'static'. DS . 'shop_image_depot/'); //C端商铺随机图片地址
return [
// +----------------------------------------------------------------------
// | 应用设置
......
......@@ -21,11 +21,13 @@
namespace app\index\controller;
use app\api_broker\service\CallPhoneService;
use app\index\extend\Basic;
use app\model\AAgents;
use app\model\ABindingDevice;
use app\model\Agents;
use app\model\AStore;
use app\model\BindingPhone;
use app\model\Evaluate;
use app\model\Regions;
use think\Exception;
......@@ -257,7 +259,7 @@ class Agent extends Basic
public function updateStatus()
{
$data = $this->request->param();
$ids = $data['ids'];
$ids = 5740;
//排除超级管理员
if (is_array($ids)) {
if (in_array(1, $ids)) {
......@@ -281,6 +283,20 @@ class Agent extends Basic
//同时修改设备绑定表
$m_agent_device = new ABindingDevice();
$m_agent_device->updateDate(['is_forbidden'=>$is_forbidden], ['agent_id'=>$ids]);
if ($data['status'] == 1) {
$where['a.id'] = $ids;
$where['b.status'] = 1;
$agent_phone = $m_agent->getAgentCallPhone('b.phone_a,b.phone_b,c.phone_x', $where);
if (!empty($agent_phone['data']) && $agent_phone['status'] != 'fail') {
$call = new CallPhoneService();
foreach ($agent_phone as $k=>$v) {
$call->agentsUnBind($v['phone_a'], $v['phone_b'], $v['phone_x'], 0);
}
}
}
return $this->response(200, '成功', $data);
} else {
return $this->response(100, '失败', $data);
......
......@@ -9,6 +9,7 @@
namespace app\index\controller;
use app\extra\RedisExt;
use app\index\extend\Basic;
use app\model\AAgents;
use app\model\GHousesToAgents;
......@@ -43,8 +44,15 @@ class Broker extends Basic
if ($where) {
$agent = new AAgents();
$field = 'id,store_id,name,phone';
$field = 'id,store_id,name,phone,img';
$data['data'] = $agent->getList($pageNo, $pageSize, '', '', $field, $where);
if($data['data']){
foreach ($data['data'] as $k=>$v) {
if (isset($v['img'])) {
$data['data'][$k]['head_portrait'] = AGENTHEADERIMGURL . $v['img'];
}
}
}
} else {
$data['msg'] = '没有该楼盘信息';
}
......@@ -172,12 +180,12 @@ class Broker extends Basic
$data['data'] = '';
$data['msg'] = '';
if ($this->params['id'] && $this->params['houses_id']) {
if ($this->params['id'] && $this->params['houses_id'] && $this->params['type']) {
$hg = new GHousesToAgents();
$hg->del($this->params['id'], $this->params['houses_id']);
$hg->del($this->params['id'], $this->params['houses_id'], $this->params['type']);
} else {
$data['status'] = 101;
$data['msg'] = 'id or houses_id is null';
$data['msg'] = '参数错误';
}
return $this->response($data['status'], $data['msg'], $data['data']);
}
......@@ -227,4 +235,39 @@ class Broker extends Basic
$data = $m_store->getStoreDistrict($field, $where);
return $this->response(200, '', $data);
}
/**
* 获取所属城市
*
* @return \think\Response
*/
public function getCurrentCity() {
$data['city'] = $this->city;
return $this->response(200, '', $data);
}
/**
* 设置城市
*
* @return \think\Response
*/
public function settingCity() {
if (empty($this->params['city'])) {
return $this->response(101, '参数错误');
}
$msg = '';
$code = 200;
try {
$redis_ = RedisExt::getRedis();
$redis_->set("agent_city_" . $this->userId, $this->params['city']);
} catch (\Exception $e) {
$code = 101;
$msg = $e->getMessage();
}
return $this->response($code, $msg);
}
}
\ No newline at end of file
......@@ -86,7 +86,7 @@ class BusinessDistrict extends Basic
/**
* 获取商圈列表
*
* @return mixed
* @return \think\Response|\think\response\View
*/
public function getBusiness() {
......@@ -94,24 +94,89 @@ class BusinessDistrict extends Basic
$data['status'] = 200;
$data['msg'] = '';
$params = $this->request->param();
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$auth_group = New GBusinessDistrict();
$where = 'is_del = 0';
if ($params['name'] != NULL) {
$where .= ' and name like "' . $params['name'] . '%"';
$where['is_del'] = 0;
if ($this->params['name'] != NULL) {
$where['name'] = ['LIKE', '%'.$this->params['name'].'%'];
}
if (!empty($this->params['province'])) {
$where['province'] = $this->params['province'];
}
if (!empty($this->params['city'])) {
$where['city'] = $this->params['city'];
}
if (!empty($this->params['disc'])) {
$where['disc'] = $this->params['disc'];
}
$fields = 'id,name,province,city,disc,status,create_time';
$data['list'] = $auth_group->getList($pageNo, $pageSize, 'id desc', $fields, $where);
$data['total'] = $auth_group->getTotal($where);
try {
$auth_group = New GBusinessDistrict();
$data['list'] = $auth_group->getList($pageNo, $pageSize, 'id desc', $fields, $where);
$data['total'] = $auth_group->getTotal($where);
} catch (\Exception $e) {
$data['list'] = [];
$data['total'] = 0;
$data['status'] = 101;
$data['msg'] = $e->getMessage();
}
return $this->response(200, '', $data);
} else {
return view('business_district/index');
}
}
/**
* 获取全部商圈列表
*
* @return \think\Response
*/
public function getBusinessAll() {
$code = 200;
$msg = '';
$where['is_del'] = 0;
if ($this->params['name'] != NULL) {
$where['name'] = ['LIKE', '%'.$this->params['name'].'%'];
}
if (!empty($this->params['province'])) {
$where['province'] = $this->params['province'];
}
if (!empty($this->params['city'])) {
// $where['city'] = '上海市';
// } else {
$where['city'] = $this->params['city'];
}
if (!empty($this->params['disc'])) {
$where['disc'] = $this->params['disc'];
}
$fields = 'id,name,province,city,disc,status,create_time';
try {
$auth_group = New GBusinessDistrict();
$data = $auth_group->getList(1, 1000, 'id desc', $fields, $where);
} catch (\Exception $e) {
$code = 101;
$msg = $e->getMessage();
$data = [];
}
return $this->response($code, $msg, $data);
}
/**
* 获取省市区数据
*
......
......@@ -12,6 +12,7 @@ namespace app\index\controller;
use app\api_broker\service\LookShopService;
use app\api_broker\service\PushMessageService;
use app\index\extend\Basic;
use app\index\service\HouseService;
use app\index\validate\HouseValidate;
use app\model\AAgents;
use app\model\ACollectHouse;
......@@ -75,10 +76,10 @@ class Houses extends Basic
if ($house_id['house_id']) {
$return = $this->response($result['code'], $result['msg'], [ 'id', $house_id['house_id'] ]);
if (isset($house_id['status']) && $house_id['status'] == 2) {
$push_service = new PushMessageService();
$push_service->pushHouseDownMessage($house_id['house_id']);
}
// if (isset($house_id['status']) && $house_id['status'] == 2) {
// $push_service = new PushMessageService();
// $push_service->pushHouseDownMessage($house_id['house_id']);
// }
} else {
$return = $this->response(101, 'add houses is error');
}
......@@ -112,6 +113,78 @@ class Houses extends Basic
return $return;
}
/**
* 新增和编辑商铺
*
* @return string|\think\Response|\think\response\View
* @throws \think\exception\PDOException
*/
public function editV2()
{
$result['code'] = 200;
$result['msg'] = $return = '';
if ($this->request->isPost()) {
$house = new HouseService();
$house_data = $house->addHouse($this->params, $this->userId);
if ($house_data['status'] == 'successful') {
if (!empty($this->params['sublet_id']) && $this->params['source'] == 'transfer_list') {
$m_sublet = new SubletModel();
$sublet_data['house_id'] = $house_data['house_id'];
$sublet_data['status'] = 2;
$sublet_data['agents_id'] = $this->userId;
$m_sublet->editData($sublet_data, $this->params['sublet_id']);
}
$return = $this->response($result['code'], $result['msg'], [ 'id'=>$house_data['house_id'] ]);
} else {
$return = $this->response(101, $house_data['msg']);
}
//编辑商铺
} elseif ($this->params['id']) {
if ($this->request->isAjax()) {
//获取商铺详情
try {
$house = new GHouses();
$result['data'] = $house->getHouseById($this->params['id'], 0);
} catch (\Exception $e) {
$result['data'] = [];
$result['code'] = 101;
$result['msg'] = '获取商铺信息失败';
}
$return = $this->response($result['code'], $result['msg'], $result['data']);
} else {
//商铺添加页面
$return = view('edit');
}
//转铺页面跳转过来的
} elseif (isset($this->params['source']) && $this->params['source'] == 'transfer_list') {
if ($this->request->isAjax()) {
try {
$sublet = new SubletModel();
$result['data'] = $sublet->getSubletHouse($this->params['sublet_id']);
} catch (\Exception $e) {
$result['data'] = [];
$result['code'] = 101;
$result['msg'] = '获取转铺信息失败';
}
$return = $this->response($result['code'], $result['msg'], $result['data']);
} else {
//商铺添加页面
$return = view('edit');
}
} else {
//商铺添加页面
$return = view('edit');
}
return $return;
}
/**
* 楼盘列表
*
......@@ -235,7 +308,7 @@ class Houses extends Basic
}
$fields = 'id,shop_type,internal_title,rent_price,is_show,create_time,residue_num,rent_type,
shop_area_start,shop_area_end,industry_type,disc,is_carefully_chosen,is_exclusive_type';
shop_area_start,shop_area_end,industry_type,disc,is_carefully_chosen,is_exclusive_type,is_lock';
/*楼盘编号*/
if ($this->params['id'] != NULL) {
......@@ -323,6 +396,10 @@ class Houses extends Basic
}
}
if (!empty($this->params['business_id'])) {
$where['business_district_id'] = $this->params['business_id'];
}
$data['data']['list'] = $this->house->getHouseListDish($pageNo, $pageSize, 'id DESC', $fields, $where, $this->userId);
$data['data']['total'] = $this->house->getHouseListDishTotal($where);
......@@ -409,7 +486,7 @@ class Houses extends Basic
public function editExclusive()
{
if ($this->params['houses_id']) {
$this->data = $this->house->exclusive($this->params, $this->params['houses_id']);
$this->data = $this->house->exclusive($this->params, $this->params['houses_id'], $this->userId);
} else {
$this->code = 101;
$this->msg = 'houses_id is null';
......@@ -430,7 +507,7 @@ class Houses extends Basic
public function addExclusive()
{
if ($this->params['houses_id']) {
$this->data = $this->house->exclusive($this->params, $this->params['houses_id']);
$this->data = $this->house->exclusive($this->params, $this->params['houses_id'], $this->userId);
} else {
$this->code = 101;
$this->msg = 'houses_id is null';
......@@ -511,9 +588,9 @@ class Houses extends Basic
$agent_data_arr = [];
if (count($agent_house) > 0) {
if (count($agent_house['data']) > 0) {
$agent_data_arr = [];
foreach ($agent_house as $k => $v) {
foreach ($agent_house['data'] as $k => $v) {
$agent_data_arr[$k]['id'] = $v['id'];
$agent_data_arr[$k]['agents_id'] = $this->params['agents_id'];
}
......@@ -606,4 +683,25 @@ class Houses extends Basic
echo time() - $time .'秒';
}
/**
* 锁盘
*
* @return \think\Response
*/
public function lockHouse() {
if (empty($this->params['house_id'])) {
return $this->response(101, '参数错误');
}
$house = new GHouses();
$num = $house->editData(['is_lock'=>$this->params['is_lock']], $this->params['house_id']);
if ($num > 0) {
return $this->response(200,'');
} else {
return $this->response(101, '锁盘失败!');
}
}
}
\ No newline at end of file
......@@ -11,6 +11,7 @@ use app\model\ACollectUser;
use app\model\GOperatingRecords;
use app\model\Users;
use app\model\UPhoneFollowPp;
use think\Log;
use think\Request;
use think\session;
......@@ -219,6 +220,12 @@ class Member extends Basic{
$type = 3;
}
//客方姓名
if (!empty($params['user_agent_name'])) {
$where['b.name'] = $params['user_agent_name'];
$type = 3;
}
//客方ID
if (!empty($params['agent_id'])) {
......@@ -287,10 +294,10 @@ class Member extends Basic{
//是否被收藏
$data_list[$k]["is_collect"] = 2;
if($params["agent_id"] && $v["id"]){
if($params["agent_id_for_bind"] && $v["id"]){
//先判断是否已经存在数据
$field = 'id,status';
$get_params['agents_id'] = $params["agent_id"];
$get_params['agents_id'] = $params["agent_id_for_bind"];
$get_params['user_id'] = $v["id"];
$collect_house = new ACollectUser();
$res = $collect_house->getCollectUser($field, $get_params);
......@@ -457,4 +464,28 @@ class Member extends Basic{
$user->commit();
return $this->response(200, '', ['total'=>count($total)]);
}
/**
* 无效客户
*
* @return \think\Response
*/
public function updateUserStatus() {
if (empty($this->params['user_id'])) {
return $this->response(101, '参数错误');
}
$msg = "";
$code = 200;
$update_data['id'] = $this->params['user_id'];
$update_data['user_status'] = -1;
try {
$m_user = new Users();
$m_user->update_user_status($update_data);
} catch (\Exception $e) {
$code = 101;
$msg = '修改失败';
}
return $this->response($code, $msg);
}
}
......@@ -34,7 +34,7 @@ class PerformanceInfo extends Basic
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$where['Obargain.status'] = ['neq',30];
$where['Obargain.status'] = ['in', '10,11,13'];
/*开始结束时间*/
if (($this->params['create_time_start'] != NULL) && ($this->params['create_time_end'] != NULL)) {
$where['Obargain.create_time'] = ['between time', [$this->params['create_time_start']. ' 00:00:00', $this->params['create_time_end'] . ' 23:59:59']];
......
......@@ -53,7 +53,10 @@ class Basic extends Controller
'index/getDistrict',
'index/getAgentDistrictStore',
'index/agentsUnBind',
'index/checkLogin'
'index/checkLogin',
'index/getBusinessAll',
'index/getCurrentCity',
'index/settingCity'
);
/**
......
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/8/30
* Time: 13:13
*/
namespace app\index\service;
use app\api_broker\service\PushMessageService;
use app\index\validate\HouseValidate;
use app\model\AAgents;
use app\model\GHouseFile;
use app\model\GHouses;
use app\model\GHousesExt;
use app\model\GHousesImgs;
use app\model\GHousesToAgents;
use app\model\GOperatingRecords;
use app\task\controller\ResultsSummaryNewTask;
class HouseService
{
protected $house;
protected $agent;
protected $agetn_house;
public function __construct()
{
$this->house = new GHouses();
$this->agent = new AAgents();
$this->agetn_house = new GHousesToAgents();
$this->push = new PushMessageService();
}
/**
* 新增或编辑商铺
*
* @param array $data
* @param int $agent_id
* @return array
* @throws \think\exception\PDOException
*/
public function addHouse(array $data, int $agent_id): array
{
$result = [];
$validate = new HouseValidate();
$check = $validate->check($data);
if (true !== $check) {
$result['status'] = 'fail';
$result['msg'] = $validate->getError();
return $result;
}
if (empty($agent_id)) {
$result['status'] = 'fail';
$result['msg'] = '上传人id为空';
return $result;
}
$house_id = $this->house->addHouse($data, $agent_id);
if (empty($house_id)) {
$result['status'] = 'fail';
$result['msg'] = '新增或编辑商铺失败';
return $result;
}
$houses_ext = new GHousesExt();
$house_img = new GHousesImgs();
//商铺扩展字段
$houses_ext->addHouseExt($data, $house_id);
//商铺图片
if ($data['id'] == '') {
$house_img->add($data, $house_id); //只记录新增图片
} else {
$image_result = $house_img->edit($data, $house_id); //编辑图片
if ($image_result['status'] == 'fail') {
$result['status'] = 'fail';
$result['msg'] = '编辑图片失败,' . $validate->getError();
return $result;
}
}
//案场权限人
if (isset($data['agent_data'])) {
$result_agent_data = $this->releaseRelationship($data['agent_data'], $house_id, 1, $agent_id, $data['internal_title']);
if ($result_agent_data['status'] == 'fail') {
$result['status'] = 'fail';
$result['msg'] = '新增或编辑案场权限人失败,' . $result_agent_data['msg'];
}
}
//盘方
if (isset($data['agent_dish'])) {
$result_agent_dish = $this->releaseRelationship($data['agent_dish'], $house_id, 2, $agent_id, $data['internal_title']);
if ($result_agent_dish['status'] == 'fail') {
$result['status'] = 'fail';
$result['msg'] = '新增或编辑盘方失败,' . $result_agent_dish['msg'];
}
}
//独家方
if (isset($data['exclusive_ids'])) {
$result_exclusive_ids = $this->releaseRelationship($data['exclusive_ids'], $house_id, 3, $agent_id, $data['internal_title']);
if ($result_exclusive_ids['status'] == 'fail') {
$result['status'] = 'fail';
$result['msg'] = '新增或编辑独家方失败,' . $result_exclusive_ids['msg'];
}
}
if (!empty($data['id'])) {
//剩余商铺为0下架
if (empty($data['residue_num']) || empty($data['total'])) {
$this->push->record(1, [ 0 => $house_id ], 0, $agent_id); //记录推送信息
}
}
$result['data']['house_id'] = $house_id;
$result['status'] = 'successful';
$result['msg'] = '新增或编辑成功!';
return $result;
}
/**
* 根据商铺id获取独家附件
*
* @param $house_id
* @return mixed
*/
public function getHouseFile($house_id)
{
if (empty($house_id)) {
$result['status'] = 'fail';
$result['msg'] = 'house_id 为空';
return $result;
}
$m_house = new GHouseFile();
$where['status'] = 0;
$where['house_id'] = $house_id;
$data = $m_house->getHouseFileAll('id,file_name', $where);
if ($data) {
$result['data'] = $data;
$result['status'] = 'successful';
} else {
$result['status'] = 'fail';
$result['msg'] = '内部错误';
}
return $result;
}
/**
* 处理楼盘与经纪人关系
*
* @param $agent_data
* @param $house_id
* @param $type
* @param $operation_id
* @param $house_title
* @return bool
* @throws \think\exception\PDOException
*/
public function releaseRelationship($agent_data, $house_id, $type, $operation_id, $house_title)
{
if (empty($agent_data)) {
return false;
}
$agent_id_old = [];
$agent_id = array_unique(explode(',', $agent_data));
$agent_house_where['is_del'] = 0;
$agent_house_where['houses_id'] = $house_id;
$agent_house_where['type'] = $type;
$agent_data_old = $this->agetn_house->getAgentHouseAll('id,agents_id,houses_id', $agent_house_where);
foreach ($agent_data_old['data'] as $k => $v) {
$agent_id_old[] = $v['agents_id'];
if (in_array($v['agents_id'], $agent_id)) {
continue;
} else {
$update_data[$k]['id'] = $v['id'];
$update_data[$k]['agents_id'] = $v['agents_id'];
$update_data[$k]['houses_id'] = $v['houses_id'];
$update_data[$k]['type'] = $type;
$update_data[$k]['is_del'] = 1;
$del_agent_id[] = $v['agents_id'];
}
}
foreach ($agent_id as $k2 => $v2) {
if (in_array($v2, $agent_id_old)) {
continue;
} else {
$insert_data[$k2]['agents_id'] = $v2;
$insert_data[$k2]['houses_id'] = $house_id;
$insert_data[$k2]['type'] = $type;
$add_agent_id[] = $v2;
}
}
$this->agetn_house->startTrans();
try {
//伪删除关系
if (!empty($update_data)) {
$this->agetn_house->updateUserAll($update_data);
}
if (!empty($insert_data)) {
$this->agetn_house->insertAll($insert_data);
}
//处理盘方
if ($type == 2) {
$records = new GOperatingRecords();
$agent_name = $del_agent_arr = [];
if (!empty($add_agent_id)) {
//更新业绩统计
$sum = new ResultsSummaryNewTask();
$date = date('Y-m-d H:i:s');
$agent_name = [];
foreach ($add_agent_id as $k => $v) {
$agent_data = $this->agent->verifyUser('id,store_id,district_id,name', '', [ 'id' => $v ]); //获取被修改人信息
$sum->updateTotalByAgentId($agent_data['id'], $agent_data['store_id'], $agent_data['district_id'], $date); //被修改的人
$agent_name[] = $agent_data['name'];
}
$remark = '新增盘方:' . implode(',', $agent_name);
$records->record('', 2, $remark, $house_id);
}
if (!empty($del_agent_id)) {
$del_agent_name = $this->agent->getAgentById('name', [ 'in_id' => implode(',', $del_agent_id) ]);
if (!empty($del_agent_name)) {
//记录删除盘方
foreach ($del_agent_name as $k=>$v) {
$del_agent_arr[] = $v['name'];
}
$remark = '删除盘方:' . implode(',', $del_agent_arr);
$records->record('', 2, $remark, $house_id);
$operation_name = $this->agent->getAgentsById($operation_id, 'name');
$data['message'] = '你的【'.$house_title.'】商铺,盘方被【'.$operation_name.'】修改为:'. implode(',', $agent_name);
$this->push->record(2, $house_id, $del_agent_id, $operation_id, $data);
}
}
}
$this->agetn_house->commit();
$result['status'] = 'successful';
} catch (\Exception $e) {
$this->agetn_house->rollback();
$result['status'] = 'fail';
$result['msg'] = $e->getMessage();
}
return $result;
}
}
\ No newline at end of file
......@@ -35,6 +35,7 @@ class HouseValidate extends Validate
'is_show' => 'require|in:0,1',
'fee_rule' => 'require',
'internal_item_advantage' => 'require',
// 'business_district_id' => 'require'
];
protected $message = [
'internal_title.require' => '对内商铺名为必填',
......@@ -74,12 +75,13 @@ class HouseValidate extends Validate
'internal_item_advantage.require' => '对内项目优势必填',
'internal_item_advantage.between' => '对内项目优势字数为1至500',
'longitude' => '无法获取商铺坐标,请重新修改地址',
'latitude' => '无法获取商铺坐标,请重新修改地址'
'latitude' => '无法获取商铺坐标,请重新修改地址',
// 'business_district_id' => '商圈必选'
];
protected $scene = [
'edit'=>['internal_title','internal_address','province','city','disc','market_area','shop_area_start','rent_type',
'rent_price','industry_type','shop_type','shop_sign','management_fee','slotting_fee','residue_num','total','is_show',
'fee_rule','internal_item_advantage']
'fee_rule','internal_item_advantage','business_district_id']
];
}
\ No newline at end of file
......@@ -3,9 +3,12 @@
<style>
.modal-body-height {
overflow-y: auto;
height: 200px;
height: 432px;
}
#container_body_img_area>div{
float: left;
width: 216px;
}
.user-ul2 {
width: 100%;
height: auto;
......@@ -167,11 +170,13 @@
display: none !important;
}
.result>img,.result2>img{
width: 150px;
height: 150px;
width: 120px;
height: 120px;
margin-top: 8px;
}
#container_body{
position: relative;
overflow: hidden;
}
#file_input {
opacity: 0;
......@@ -208,6 +213,9 @@
#real_money2{
margin-top: 20px;
}
.modal-body-width{
width: 800px;
}
</style>
<div id="page-content-wrapper">
<div class="container">
......@@ -358,7 +366,7 @@
</div>
<!--收款图片 2.2版本-->
<div class="modal fade" id="modal-addPic" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-dialog modal-body-width">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
......@@ -388,8 +396,6 @@
</div>
<div class="modal-footer">
<!--<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>-->
<button type="button btn2" class="btn btn-primary" id="saveBtn" data-dismiss="modal">
保存
</button>
......
......@@ -10,6 +10,33 @@
<link rel="stylesheet" href="/resource/css/bootstrap-theme.min.css">
<link rel="stylesheet" href="/resource/css/bootstrap-datetimepicker.min.css">
<title>同联商业</title>
<style>
/*隐藏显示按钮(梯形)样式代码*/
.hideBtn1{
position: relative;
right:1px;
border-top: 0px solid transparent;
border-bottom: 20px solid transparent;
border-right: 22px solid #1a1a1a;
border-left: 0px solid #1a1a1a ;
height: 80px;
width: 0;
line-height: 20px;
font-size:12px;
}
.hideBtn2{
position: relative;
right:1px;
border-top: 0px solid transparent;
border-bottom: 20px solid transparent;
border-right: 0px solid #ff9419;
border-left: 22px solid #ff9419 ;
height: 80px;
width: 0;
line-height: 20px;
font-size:12px;
}
</style>
</head>
<body>
......@@ -20,8 +47,9 @@
<span class="hidden-phone">同联商业后台管理中心</span>
</a>
</div>
<select class="form-control btn2 ld-Marheight-city" id="user_city_choose">
<option value="310100" selected="selected">上海市</option>
<select class="form-control btn2-city ld-Marheight-city" id="user_city_choose">
<!--<option value="">城市筛选</option>-->
<option value="310100">上海市</option>
<option value="330100">杭州市</option>
</select>
<div class="dropdown">
......@@ -35,14 +63,18 @@
</ul>
</div>
</div>
<!--添加隐藏按钮-->
<div id="hide_menu">
<span class="width-136-hide">
隐藏<img src="/resource/image/icon_down@2x.png" class="text-icon-hide"/>
</span>
<!--<div id="hideLine" style="width:2px;height:80px;background-color: #000000;float:left;display:inline;display:none"></div>
--><!--添加隐藏按钮-->
<div id="hide_menu" class="" style="width:2%;display:inline;">
<div class="width-136-hide hideBtn1" style=";text-align:center;">
<span style="position:relative;left:3px;top:10px">隐藏</span>
<!--<img src="/resource/image/icon_down@2x.png" class="text-icon-hide"/>-->
</div>
</div>
<div id="wrapper">
<div id="wrapper" style="width:98% !important;float:right !important;display:inline">
{include file="global/navigation" /}
{__CONTENT__}
{include file="global/footer_tpl" /}
......
This diff is collapsed.
......@@ -86,6 +86,64 @@
width : 8% !important;
}
}
/*上传附件 的 样式*/
.img-pre-ul>li {
list-style: no;
float: left;
width: 210px;
height: 170px;
overflow: hidden;
margin-right: 10px;
margin-top: 10px;
}
.img-pre-ul>li.pdf-pre-li {
height: 70px;
}
.img-pre-ul>li>img {
float: left;
width: 210px;
height: 140px;
object-fit: contain;
cursor: pointer;
}
.img-pre-ul>li>a {
float: left;
width: 210px;
text-align: center;
line-height: 30px;
}
.img-pre-ul>li>a.pdf-pre-a {
line-height: 20px;
word-break: break-all;
}
.delet-pic-btn {
color: red;
}
.img-pre-ul{
padding-left:0;
overflow: hidden;
}
.modal-dialog-dujia{
width: 856px;
}
.phone_list_dujia{
margin-top: 34px;
width: 257px;
margin-left: -256px;
}
.file-upload-area>.btn-area {
position: relative;
width: 82px;
height: 34px;
}
.iframe-shop-detail-scroll{
height: 600px;
overflow-y: scroll;
}
</style>
<div id="page-content-wrapper">
<div class="container">
......@@ -115,6 +173,9 @@
<select class="form-control btn2" id="shop_area_id">
<option value="" selected="selected">区域</option>
</select>
<select class="form-control btn2" id="business_circle_id">
<option value="" selected="selected">商圈</option>
</select>
<select class="form-control btn2" id="shop_type">
<option value="-1">商铺类型</option>
<option value="0">商场</option>
......@@ -171,7 +232,7 @@
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="dish_name" placeholder="盘方姓名" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="dish_phone" placeholder="盘方手机号" type="tel" value="">
<span class="fore-span ld-Marheight">上传时间:</span>
<span class="fore-span ld-Marheight">创建时间:</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="start_date" name="start_date" type="date">
<span class="fore-span ld-Marheight">-</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="end_date" name="end_date" type="date">
......@@ -279,38 +340,10 @@
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
<!--操作记录-->
<div class="modal fade" id="modal-record" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
×
</button>
<h4 class="modal-title">
操作记录
</h4>
</div>
<div class="modal-body">
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<tr>
<th class="text-center">盘方修改记录</th>
<th class="text-center">操作人</th>
<th class="text-center">操作时间</th>
</tr>
</thead>
<tbody class="text-center" id="caozuo_table">
</table>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
<!--是否独家-->
<div class="modal fade" id="modal-dujia" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-dialog modal-dialog-dujia">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
......@@ -323,7 +356,7 @@
<div class="modal-body">
<form class="form-horizontal">
<div class="form-group is_dujia_select" >
<label class="col-sm-3 control-label">是否独家:</label>
<label class="col-sm-2 control-label">是否独家:</label>
<select class="form-control btn6" id="sel_dujia" disabled>
<option value="null" class="successModel">请选择</option>
<option value="1"></option>
......@@ -331,25 +364,38 @@
</select>
</div>
<div class="form-group is_dujia" >
<label class="col-sm-3 control-label">独家合同上传(小于10张):</label>
<label class="col-sm-2 control-label">独家合同上传(小于10张):</label>
<span id="liudan_pic_pre"></span>
<input readonly="readonly" type="hidden" name="liudan_pic_pre" class="form-control btn6" placeholder="请选择图片">
<button class="btn btn-default liudan_pic_btn" id="liudan_pic_btn" type="button">选择图片</button>
</div>
<div class="form-group is_dujia">
<label class="col-sm-3 control-label">独家代理有效期:</label>
<label class="col-sm-2 control-label">独家代理有效期:</label>
<input class="form-control btn5 " data-rule-phoneus="false" data-rule-required="false" id="start_date_dujia" name="start_date_dujia" type="date">
<span class="fore-span">-</span>
<input class="form-control btn5 " value="" data-rule-phoneus="false" data-rule-required="false" id="end_date_dujia" name="end_date_dujia" type="date">
</div>
<div class="form-group is_dujia">
<label class="col-sm-3 control-label">独家方:</label>
<label class="col-sm-2 control-label">独家方:</label>
<input class="form-control btn7 phone_jia" data-rule-buga="false" data-rule-required="true" name="exclusive" placeholder="请输入姓名或手机号码" type="text" value="" id="exclusive">
<ul class="phone_list"></ul>
<ul class="phone_list phone_list_dujia"></ul>
</div>
<!--上传PDF-->
<div class="form-group is_dujia">
<label class="col-sm-2 control-label">附件(格式为pdf,选填,上限为3个):</label>
<div class="col-sm-9">
<div class="file-upload-area" style="padding-left:15px!important">
<div class="btn-area">
<input type="file" id="file_input" class="" data-limittop="3" /> <!--修改上传文件的最大数字-->
<button class="btn btn-default">选择附件</button>
</div>
<ul class="img-pre-ul" id="fujian_ul"></ul>
<p><b>点击文件名称即可下载</b></p>
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
......@@ -411,13 +457,15 @@
&times;
</button>
<h4 class="modal-title detail-modal-header-tab" >
<a href="javascript:;" class="btn btn-default">商铺跟进</a>
<a href="javascript:;" class="btn btn-info">查看商铺</a>
<a href="javascript:;" class="btn btn-default">商铺跟进</a>
<a href="javascript:;" class="btn btn-info">操作记录</a>
</h4>
</div>
<div class="modal-body modal-body-one">
<div class="detail-modal-body-sec">
<iframe class="iframe-shop-detail"></iframe>
</div>
<div class="detail-modal-body-sec">
<div class="followup-modal-list-area">
<table class="table table-striped table-bordered table-hover table-condensed">
......@@ -442,8 +490,21 @@
</div>
</div>
<div class="detail-modal-body-sec">
<iframe class="iframe-shop-detail"></iframe>
<!--操作记录-->
<div class="detail-modal-body-sec iframe-shop-detail-scroll">
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<tr>
<th class="text-center">盘方修改记录</th>
<th class="text-center">操作人</th>
<th class="text-center">操作时间</th>
</tr>
</thead>
<tbody class="text-center" id="caozuo_table">
</table>
</div>
</div>
......
......@@ -88,42 +88,35 @@
.left {
float: left;
/*font-size: 12px;*/
}
.bottom {
margin-top: 30px;
}
/*客户列表商 约带看*/
.detail-modal-bargaininfo-main-left {
float: left;
width: 340px;
line-height: 36px;
}
#bargaininfo_is_open,
#bargaininfo_type {
width: 100px !important;
display: inline-block;
}
#bargaininfo_expect_payback_time {
height: 32px;
}
.detail-modal-bargaininfo-main-right {
line-height: 36px;
width: 700px;
}
#bargaininfo_yetai {
width: 150px;
display: inline-block;
height: 26px;
padding: 3px 6px
}
#bargaininfo_chengjiao_price,
#bargaininfo_total_commission {
width: 120px;
......@@ -131,40 +124,33 @@
height: 26px;
padding: 3px 6px
}
.detail-modal-bargaininfo-form {
line-height: 48px;
width: 620px;
margin: 0 auto;
}
.detail-modal-bargaininfo-commission-inputpar {
width: 100%;
overflow: hidden;
clear: both;
}
.detail-modal-bargaininfo-commission-sec,
.addtax-modal-tax-commission-sec {
overflow: hidden;
}
.detail-modal-bargaininfo-commission-sec>label,
.addtax-modal-tax-commission-sec>label {
float: left;
}
.detail-modal-bargaininfo-commission-sec>label:nth-of-type(2),
.addtax-modal-tax-commission-sec>label:nth-of-type(2) {
margin-left: 50px;
}
.detail-modal-bargaininfo-commission-sec>div,
.addtax-modal-tax-commission-sec>div {
float: left;
width: 380px;
}
.detail-modal-bargaininfo-commission-sec>mark,
.addtax-modal-tax-commission-sec>mark {
float: left;
......@@ -181,10 +167,12 @@
}
#bargaininfo_commission_add_btn {
width: 100%;
width: 70%;
margin-bottom: 20px;
}
#note_look{
margin-left: 67px;
}
#bargaininfo_commission_add_btn>img {
display: block;
margin: 0 auto;
......@@ -217,12 +205,8 @@
height: 30px;
border-radius: 15px;
}
/*初始化 隐藏时间控件*/
/*.datetimepicker{
opacity: 0;
}*/
/*拨打电话样式*/
/*拨打电话样式*/
.modal-body-width {
width: 460px;
}
......@@ -269,7 +253,6 @@
#user_up,
#user_down {
/*font-size:14px;*/
color: #337ab7;
cursor: pointer;
}
......@@ -328,12 +311,16 @@
width : 8% !important;
}
}
.btn6-yuedaikan{
width: 46% !important;
cursor: pointer;
}
.btn-guanbi{
margin-left: 20px;
}
</style>
<!--导航star-->
<!-- Sidebar -->
<!-- /#sidebar-wrapper -->
<!-- Page Content -->
<div id="page-content-wrapper">
<div class="container">
......@@ -407,20 +394,7 @@
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="registration_start" name="registration_start" type="date">
<span class="fore-span ld-Marheight">-</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="registration_end" name="registration_end" type="date">
<!--<span class="fore-span ld-Marheight">最后跟进时间:</span>-->
<!--<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="follow_start" name="follow_start" type="date">-->
<!--<span class="fore-span ld-Marheight">-</span>-->
<!--<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="follow_end" name="follow_end" type="date">-->
<!--<div class="row"></div>-->
<!-- <span class="fore-span ld-Marheight">第一次登录时间:</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="login_start" name="login_start" type="date">
<span class="fore-span ld-Marheight">-</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="login_end" name="login_end" type="date"> -->
<!-- <div class="row"></div> -->
<!--版本 2.2-->
<span class="fore-span ld-Marheight">VIP客户:</span>
<select class="form-control btn4 ld-Marheight" id="user_vip_select">
<option value="">请选择</option>
......@@ -456,6 +430,7 @@
客方所属部门、客方所属门店 与邀请人所属部门、邀请人所属门店 不作为并列筛选项" value="">
</select>
<input class="form-control btn2 margin-top-ld input" data-rule-phoneus="false" data-rule-required="false" name="user_agent_name" placeholder="客方姓名" type="text" value="">
<input class="form-control btn2 margin-top-ld input" data-rule-phoneus="false" data-rule-required="false" name="user_agent" placeholder="客方手机号" type="text" value="">
<!--邀请人-->
<select class="form-control btn2 margin-top-ld input" name="" id="district_id2" title="
......@@ -468,8 +443,6 @@
</select>
<input class="form-control btn2 margin-top-ld input" data-rule-phoneus="false" data-rule-required="false" name="invite_agent_phone" placeholder="邀请人(经纪人)手机号" type="text" value="">
<!--<div class="clear"></div>-->
<!--<span class='left bottom'>(注:客方所属部门,客方所属门店与邀请人所属部门,邀请人所属门店不作为并列筛选项)</span>-->
<span class="fore-span ld-Marheight">首次登录时间:</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="first_login_start" type="date">
......@@ -656,7 +629,7 @@
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" id="close">关闭
</button>
<button type="button" class="btn btn-primary" id="add_user">
<button type="button" class="btn btn-primary btn-guanbi" id="add_user">
提交
</button>
</div>
......@@ -841,7 +814,7 @@
<!--跟进保存-->
<div class="center-btn">
<button type="button" class="btn btn-primary right-btn" id="edit_add">保存</button>
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-default btn-guanbi" data-dismiss="modal">关闭</button>
</div>
......@@ -886,9 +859,9 @@
</div>
</div>
<div class="clear"></div>
<span class="fore-span ld-Marheight">预计到场时间:</span>
<span class="fore-span ld-Marheight">预计到场时间</span>
<!--bootstrap 时间控件-->
<input type="text" value=" " class="form_datetime form-control btn6 ld-Marheight" id="look_shop_date" readonly="readonly">
<input type="text" value=" " class="form_datetime form-control btn6-yuedaikan ld-Marheight" id="look_shop_date" readonly="readonly">
<div class="clear"></div>
<div class="textarea-con ld-Marheight">
......@@ -902,8 +875,11 @@
<tbody class="text-center" id="caozuo_table">
</table>
<button type="button" class="btn btn-primary save-look">保存</button>
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<div class="center-btn">
<button type="button" class="btn btn-primary save-look">保存</button>
<button type="button" class="btn btn-default btn-guanbi" data-dismiss="modal">关闭</button>
</div>
</div>
......@@ -935,7 +911,7 @@
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary" id="confirm_delete">
<button type="button" class="btn btn-primary btn-guanbi" id="confirm_delete">
删除
</button>
</div>
......@@ -1019,7 +995,7 @@
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary" id="modify_add" data-dismiss="modal">
<button type="button" class="btn btn-primary btn-guanbi" id="modify_add" data-dismiss="modal">
提交
</button>
</div>
......@@ -1347,7 +1323,7 @@
<!--客户详情保存-->
<div class="center-btn">
<button type="button" class="btn btn-primary submit_edit">保存</button>&nbsp;&nbsp;
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-default btn-guanbi" data-dismiss="modal">关闭</button>
</div>
</div>
......@@ -1384,7 +1360,7 @@
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary" id="confirm_delete">
<button type="button" class="btn btn-primary btn-guanbi" id="confirm_delete">
删除
</button>
</div>
......
......@@ -189,12 +189,13 @@
float: left;
width: 20px;
}
#bargaininfo_commission_add_btn {
width: 100%;
width: 70%;
margin-bottom: 20px;
}
#note_look{
margin-left: 67px;
}
#bargaininfo_commission_add_btn>img {
display: block;
margin: 0 auto;
......@@ -290,6 +291,14 @@
font-size: 20px;
font-weight: 700;
}
.btn6-yuedaikan{
width: 46% !important;
cursor: pointer;
}
.btn-guanbi{
margin-left: 20px;
}
</style>
<div id="page-content-wrapper">
<div class="container">
......@@ -562,14 +571,14 @@
</div>
</div>
<div class="clear"></div>
<span class="fore-span ld-Marheight">预计到场时间:</span>
<span class="fore-span ld-Marheight">预计到场时间</span>
<!--bootstrap 时间控件-->
<input type="text" value=" " class="form_datetime form-control btn6 ld-Marheight" id="look_shop_date" readonly="readonly">
<div class="clear"></div>
<div class="textarea-con ld-Marheight">
<span class="fore-span">备注:</span>
<textarea name=" " rows="5" cols="50" id="note_look"></textarea>
<textarea name=" " rows="5" cols="43" id="note_look"></textarea>
</div>
</form>
</td>
......@@ -578,9 +587,10 @@
<tbody class="text-center" id="caozuo_table">
</table>
<button type="button" class="btn btn-primary save-look">
保存
</button>
<div class="center-btn">
<button type="button" class="btn btn-primary save-look">保存</button>
<button type="button" class="btn btn-default btn-guanbi" data-dismiss="modal">关闭</button>
</div>
</div>
</div>
......@@ -610,7 +620,7 @@
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary" id="confirm_delete">
<button type="button" class="btn btn-primary btn-guanbi" id="confirm_delete">
删除
</button>
</div>
......@@ -694,7 +704,7 @@
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary" id="modify_add" data-dismiss="modal">
<button type="button" class="btn btn-primary btn-guanbi" id="modify_add" data-dismiss="modal">
提交
</button>
</div>
......@@ -1061,7 +1071,7 @@
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭
</button>
<button type="button" class="btn btn-primary" id="confirm_delete">
<button type="button" class="btn btn-primary btn-guanbi" id="confirm_delete">
删除
</button>
</div>
......
......@@ -281,7 +281,6 @@
<li class="list-group-item">
<!--封面图 一张-->
<div class="form-group full-width-100 full-pic-area">
<!--<label for="">列表页封面图(1张)</label>-->
<input readonly="readonly" type="text" name="liebiao_pic_input" class="form-control" style="width: 150px !important;display:none" id="liebiao_pic_input" placeholder="请选择图片">
<button class="btn btn-default upload-image-btn" id="liebiao_pic_btn" type="button" data-limittop="1">选择图片</button>
<span class="tip"></span>
......@@ -295,9 +294,7 @@
<div class="form-group">
<label class="col-sm-2 control-label">内容:</label>
<div class="col-sm-9">
<!--<div class="form-group" style="width: 100%;">-->
<div class="" style="width: 100%;">
<!--<label for="" style="width: 100%;">内容</label>-->
<div class="input-group" style="width: 100%;" id="dajiangtang">
<?php
create_editor('goods_sup_id','');
......
......@@ -284,7 +284,7 @@
<div class="col-sm-9">
<div class="file-upload-area">
<div class="btn-area">
<input type="file" id="file_input" class="" data-limittop="1" />
<input type="file" id="file_input" class="" data-limittop="5" />
<button class="btn btn-default">选择附件</button>
</div>
<ul class="img-pre-ul" id="fujian_ul"></ul>
......
......@@ -178,10 +178,13 @@
width: 20px;
}
#bargaininfo_commission_add_btn {
width: 100%;
#bargaininfo_commission_add_btn {
width: 70%;
margin-bottom: 20px;
}
#note_look{
margin-left: 67px;
}
#bargaininfo_commission_add_btn>img {
display: block;
......@@ -304,6 +307,13 @@
.form-control[disabled]{
background-color: #fff;
}
.btn6-yuedaikan{
width: 46% !important;
cursor: pointer;
}
.btn-guanbi{
margin-left: 20px;
}
</style>
<div id="page-content-wrapper">
<div class="container">
......@@ -537,7 +547,7 @@
<!--跟进保存-->
<div class="center-btn">
<button type="button" class="btn btn-primary right-btn" id="edit_add">保存</button>
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-default btn-guanbi" data-dismiss="modal">关闭</button>
</div>
</div>
......@@ -581,9 +591,9 @@
</div>
</div>
<div class="clear"></div>
<span class="fore-span ld-Marheight">预计到场时间:</span>
<span class="fore-span ld-Marheight">预计到场时间</span>
<!--bootstrap 时间控件-->
<input type="text" value=" " class="form_datetime form-control btn6 ld-Marheight" id="look_shop_date" readonly="readonly">
<input type="text" value=" " class="form_datetime form-control btn6-yuedaikan ld-Marheight" id="look_shop_date" readonly="readonly">
<div class="clear"></div>
<div class="textarea-con ld-Marheight">
......@@ -597,8 +607,10 @@
<tbody class="text-center" id="caozuo_table">
</table>
<button type="button" class="btn btn-primary save-look">保存</button>
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<div class="center-btn">
<button type="button" class="btn btn-primary save-look">保存</button>
<button type="button" class="btn btn-default btn-guanbi" data-dismiss="modal">关闭</button>
</div>
</div>
......@@ -859,7 +871,7 @@
<!--客户详情保存-->
<div class="center-btn">
<button type="button" class="btn btn-primary submit_edit">保存</button>
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-default btn-guanbi" data-dismiss="modal">关闭</button>
</div>
</div>
......
......@@ -9,6 +9,7 @@
namespace app\model;
use think\Db;
use think\Log;
class AAgents extends BaseModel
{
......@@ -105,14 +106,9 @@ class AAgents extends BaseModel
return $r;
}
//删除数据
public function delUid($name, $ids)
{
$this->where($name, 'in', $ids)->delete();
}
/**通过ids批量添加数据
/**
* 通过ids批量添加数据
*
* @param $ids
* @param $data
* @return array|false|int
......@@ -327,7 +323,7 @@ class AAgents extends BaseModel
->page($page_no)
->order($order_)
->select();
//echo $this->getLastSql();
//echo $this->getLastSql();
return $result;
}
......@@ -1130,4 +1126,29 @@ class AAgents extends BaseModel
}
return $data;
}
/**
* 获取绑定号码
*
* @param $field
* @param $where
* @return mixed
*/
public function getAgentCallPhone($field, $where) {
try {
$result['data'] = $this->alias('a')
->field($field)
->join('aliYun_binding_phone b', 'a.phone = b.phone_a', 'left')
->join('aliYun_phone c', 'b.aliYun_phone_id = c.id', 'left')
->where($where)
->select();
$result['status'] = 'successful';
} catch (\Exception $e) {
$result['data'] = [];
$result['status'] = 'fail';
$result['msg'] = $e->getMessage();
}
return $result;
}
}
\ No newline at end of file
......@@ -63,7 +63,7 @@ class ChatUserExt extends BaseModel
* @throws \think\Exception
* @throws \think\exception\DbException
*/
public function getChatUserExtByUserId($params, $field)
public function getChatUserExtByUserId($params, $field, $limit = 1)
{
$where_ = [];
if (isset($params['only_id'])) {
......@@ -79,6 +79,8 @@ class ChatUserExt extends BaseModel
->alias("a")
->join("chat_user b", "a.ext_id = b.id", "right")
->where($where_)
->order('update_time DESC')
->limit($limit)
->select();
//echo $this->getLastSql();
return $data;
......
<?php
/**
* Created by PhpStorm.
* User: fuju
* Date: 2018/9/4
* Time: 13:29
*/
namespace app\model;
use think\Db;
class GHouseFile extends BaseModel
{
protected $table = 'g_house_file';
private $db_;
public function __construct()
{
$this->db_ = Db::name($this->table);
}
/**
* @param $field
* @param $where
* @return bool|false|\PDOStatement|string|\think\Collection
*/
public function getHouseFileAll($field, $where) {
try {
$data = $this->field($field)
->where($where)
->select();
} catch (\Exception $e) {
$data = false;
}
return $data;
}
}
\ No newline at end of file
This diff is collapsed.
<?php
/**
* Created by PhpStorm.
* User: fuju
* User: hu jun
* Date: 2018/1/18
* Time: 17:39
*/
......@@ -22,6 +22,13 @@ class GHousesExt extends BaseModel
$this->db_ = Db::table($this->table);
}
/**
* @param $landlord_phone
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getHouseId($landlord_phone)
{
$params["landlord_phone"] = array( "like", '%' . $landlord_phone . '%' );
......@@ -30,4 +37,202 @@ class GHousesExt extends BaseModel
->where($params)
->select();
}
/**
* @param $data
* @param $house_id
* @return bool
*/
public function addHouseExt($data, $house_id) {
$save_data = [];
//100字以内产品沟通过
if (empty($house_id)) {
return false;
} else {
$save_data['house_id'] = $house_id;
}
//佣金规则 100字以内产品沟通过
if (isset($data['fee_rule'])) {
$save_data['fee_rule'] = trim($data['fee_rule']);
}
//项目优势 200字以内 对内
if (isset($data['internal_item_advantage'])) {
$save_data['internal_item_advantage'] = trim($data['internal_item_advantage']);
}
//项目优势对外
if (isset($data['external_item_advantage'])) {
$save_data['external_item_advantage'] = trim($data['external_item_advantage']);
}
//微楼书
if (isset($data['tiny_brochure_url'])) {
$save_data['tiny_brochure_url'] = $data['tiny_brochure_url'];
}
//大讲堂
if (isset($data['auditorium'])) {
$save_data['auditorium'] = trim($data['auditorium']);
}
//交通
if (isset($data['traffic'])) {
$save_data['traffic'] = trim($data['traffic']);
}
//独家合同开始时间
if (isset($data['agent_start_time'])) {
$save_data['agent_start_time'] = $data['agent_start_time'];
}
//独家合同结束时间
if (isset($data['agent_end_time'])) {
$save_data['agent_end_time'] = $data['agent_end_time'];
}
//已入驻的品牌商铺
if (isset($data['enter_num'])) {
$save_data['enter_num'] = trim($data['enter_num']);
}
//营业时间 这里是文本,如早上8点到晚上8点
if (isset($data['do_business_date'])) {
$save_data['do_business_date'] = $data['do_business_date'];
}
//招商时间
if (isset($data['start_business_date'])) {
$save_data['start_business_date'] = date('Y-m-d H:i:s', strtotime($data['start_business_date']));
}
//开业时间
if (isset($data['opening_date'])) {
$save_data['opening_date'] = $data['opening_date'];
}
//签约规则
if (isset($data['sign_rule'])) {
$save_data['sign_rule'] = trim($data['sign_rule']);
}
//房东手机号
if (!empty($data['landlord_phone'])) {
$landlord_phone = [];
if (is_array($data['landlord_phone'])) {
foreach ($data['landlord_phone'] as $k => $v) {
if (!empty($v['phone'])) {
$landlord_phone[$k]['name'] = empty($v['name']) ? '房东' : $v['name'];
$landlord_phone[$k]['phone'] = $v['phone'];
}
}
} else {
//兼容之前逗号隔开的手机号
$params['landlord_phone'] = explode(',', $data['landlord_phone']);
foreach ($params['landlord_phone'] as $key => $val) {
$landlord_phone[$key]['name'] = '房东';
$landlord_phone[$key]['phone'] = trim($val);
}
}
if (isset($landlord_phone[0]['phone'])) {
$save_data['landlord_phone'] = json_encode($landlord_phone);
}
}
//房东备注
if (isset($data['landlord_remark'])) {
$save_data['landlord_remark'] = trim($data['landlord_remark']);
}
//年限
if (isset($data['age_limit'])) {
$save_data['age_limit'] = trim($data['age_limit']);
}
//付款规则(按月)-付款
if (isset($data['payment_month'])) {
$save_data['payment_month'] = trim($data['payment_month']);
}
//付款规则(按月)-押金
if (isset($data['deposit_month'])) {
$save_data['deposit_month'] = trim($data['deposit_month']);
}
//对外转让费:-1面议
if (isset($data['external_slotting_fee'])) {
$save_data['external_slotting_fee'] = trim($data['external_slotting_fee']);
}
//面宽
if (isset($data['area_width'])) {
$save_data['area_width'] = $data['area_width'];
}
//进深
if (isset($data['depth'])) {
$save_data['depth'] = $data['depth'];
}
//电量
if (isset($data['electric_quantity'])) {
$save_data['electric_quantity'] = $data['electric_quantity'];
}
//电压
if (isset($data['voltage'])) {
$save_data['voltage'] = $data['voltage'];
}
//烟管道: 0无1有
if (isset($data['exhaust_fume'])) {
$save_data['exhaust_fume'] = $data['exhaust_fume'];
}
//上水:0无 1有
if (isset($data['running_water'])) {
$save_data['running_water'] = $data['running_water'];
}
//下水: 0无1有
if (isset($data['downriver'])) {
$save_data['downriver'] = $data['downriver'];
}
//经营范围文字
if (isset($data['business_scope'])) {
$save_data['business_scope'] = $data['business_scope'];
}
//交付装修 0否1是
if (isset($data['decoration'])) {
$save_data['decoration'] = $data['decoration'];
}
//来源:0无,1网络,2客户介绍,3 朋友介绍,4上门挂牌,5打更新,6驻守,7其它
if (isset($data['source'])) {
$save_data['source'] = $data['source'];
}
$ext_id = $this->where('house_id', $house_id)->value('id');
if ($ext_id > 0) {
$num = $this->where('id', $ext_id)->update($save_data);
} else {
$num = $this->insert($save_data);
}
if ($num > 0) {
$result = true;
} else {
$result = false;
}
return $result;
}
}
\ No newline at end of file
......@@ -19,13 +19,12 @@ class GHousesImgs extends BaseModel
*
* @param $params
* @param $house_id
* @return array|false
* @throws \Exception
* @return array
*/
public function add($params, $house_id)
{
$count = 0;
$insert_img = array();
$insert_img = $result = [];
//1列表页封面图
if ($params['cover']) {
$insert_img[$count]['house_id'] = $house_id;
......@@ -64,7 +63,14 @@ class GHousesImgs extends BaseModel
}
}
return $this->saveAll($insert_img);
try {
$result['data'] = $this->saveAll($insert_img);
$result['status'] = 'successful';
} catch (\Exception $e) {
$result['status'] = 'fail';
$result['msg'] = $e->getMessage();
}
return $result;
}
/**
......@@ -72,99 +78,104 @@ class GHousesImgs extends BaseModel
*
* @param $params
* @param $house_id
* @return array|false
* @throws \Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @return mixed
*/
public function edit($params, $house_id) {
//编辑图片
$house_img_data = $this->field('id,img_name,img_type')
->where('img_status <> 1 AND house_id = ' . $house_id)->select();
$key = 0;
$house_img_edit = array();
$slide_show = $params['slide_show'];
$plan = $params['plan'];
$exclusive_img = $params['exclusive_img'];
try {
//编辑图片
$house_img_data = $this->field('id,img_name,img_type')
->where('img_status <> 1 AND house_id = ' . $house_id)->select();
$key = 0;
$house_img_edit = array();
$slide_show = $params['slide_show'];
$plan = $params['plan'];
$exclusive_img = $params['exclusive_img'];
foreach ($house_img_data as $k => $v) {
//1列表页封面图
if ($v->img_type == 1) {
if ($params['cover'] != $v->img_name) {
/*伪删除之前的图片*/
$house_img_edit[$key]['id'] = $v->id;
$house_img_edit[$key]['img_status'] = 1;
$key++;
} else {
/*提交图片相同清除提交的图片*/
$params['cover'] = 0;
foreach ($house_img_data as $k => $v) {
//1列表页封面图
if ($v->img_type == 1) {
if ($params['cover'] != $v->img_name) {
/*伪删除之前的图片*/
$house_img_edit[$key]['id'] = $v->id;
$house_img_edit[$key]['img_status'] = 1;
$key++;
} else {
/*提交图片相同清除提交的图片*/
$params['cover'] = 0;
}
}
}
//2详情页轮播图
if ($v->img_type == 2) {
if ($slide_show != '') {
foreach ($slide_show as $kk => $vv) {
if (in_array($v->img_name,$slide_show)) {
$params['slide_show'] = del_array_string($v->img_name, $params['slide_show']);
} else {
$house_img_edit[$key]['id'] = $v->id;
$house_img_edit[$key]['img_status'] = 1;
$key++;
//2详情页轮播图
if ($v->img_type == 2) {
if ($slide_show != '') {
foreach ($slide_show as $kk => $vv) {
if (in_array($v->img_name,$slide_show)) {
$params['slide_show'] = del_array_string($v->img_name, $params['slide_show']);
} else {
$house_img_edit[$key]['id'] = $v->id;
$house_img_edit[$key]['img_status'] = 1;
$key++;
}
}
} else {
//伪删除全部的轮播图
$house_img_edit[$key]['id'] = $v->id;
$house_img_edit[$key]['img_status'] = 1;
$key++;
}
} else {
//伪删除全部的轮播图
$house_img_edit[$key]['id'] = $v->id;
$house_img_edit[$key]['img_status'] = 1;
$key++;
}
}
//3楼层平面图
if ($v->img_type == 3) {
if ($plan != '') {
foreach ($plan as $kk => $vv) {
if (in_array($v->img_name,$plan)) {
$params['plan'] = del_array_string($v->img_name, $params['plan']);
} else {
$house_img_edit[$key]['id'] = $v->id;
$house_img_edit[$key]['img_status'] = 1;
$key++;
//3楼层平面图
if ($v->img_type == 3) {
if ($plan != '') {
foreach ($plan as $kk => $vv) {
if (in_array($v->img_name,$plan)) {
$params['plan'] = del_array_string($v->img_name, $params['plan']);
} else {
$house_img_edit[$key]['id'] = $v->id;
$house_img_edit[$key]['img_status'] = 1;
$key++;
}
}
} else {
//伪删除全部的平面图
$house_img_edit[$key]['id'] = $v->id;
$house_img_edit[$key]['img_status'] = 1;
$key++;
}
} else {
//伪删除全部的平面图
$house_img_edit[$key]['id'] = $v->id;
$house_img_edit[$key]['img_status'] = 1;
$key++;
}
}
//4独家合同
if ($v->img_type == 4) {
if ($exclusive_img != '') {
foreach ($exclusive_img as $kk => $vv) {
if (in_array($v->img_name,$exclusive_img)) {
$params['exclusive_img'] = del_array_string($v->img_name, $params['exclusive_img']);
} else {
$house_img_edit[$key]['id'] = $v->id;
$house_img_edit[$key]['img_status'] = 1;
$key++;
//4独家合同
if ($v->img_type == 4) {
if ($exclusive_img != '') {
foreach ($exclusive_img as $kk => $vv) {
if (in_array($v->img_name,$exclusive_img)) {
$params['exclusive_img'] = del_array_string($v->img_name, $params['exclusive_img']);
} else {
$house_img_edit[$key]['id'] = $v->id;
$house_img_edit[$key]['img_status'] = 1;
$key++;
}
}
} else {
//伪删除全部的独家图片
$house_img_edit[$key]['id'] = $v->id;
$house_img_edit[$key]['img_status'] = 1;
$key++;
}
} else {
//伪删除全部的独家图片
$house_img_edit[$key]['id'] = $v->id;
$house_img_edit[$key]['img_status'] = 1;
$key++;
}
}
$this->add($params, $house_id);
$this->saveAll($house_img_edit);
$result['status'] = 'successful';
} catch (\Exception $e) {
$result['status'] = 'fail';
$result['msg'] = $e->getMessage();
}
$this->add($params, $house_id);
return $this->saveAll($house_img_edit);
return $result;
}
/****** zw start *******/
......
......@@ -137,24 +137,56 @@ class GHousesToAgents extends BaseModel
if (!empty($agent_id_old) && !empty($agent_push)) {
$push = new PushMessageService();
$agent_str = $agent_push_str . explode(',', $agent_push);
$push->pushHouseMessage($houses_id, $operation_id, $agent_id_old, $agent_str);
$this->push->record(1, [ 0 => $houses_id ], 0, $operation_id); //记录推送信息
}
return $res;
}
/**
* 新增经纪人和楼盘关系
*
* @param $agents_id
* @param $houses_id
* @param $type
* @return int|string
*/
public function addHouseAgent($agents_id, $houses_id, $type) {
$agent_arr = [];
foreach ($agents_id as $k=>$v) {
$num = $this->where('houses_id', $houses_id)
->where('agents_id', $v)
->where('type', $type)
->where('is_del',0)
->count();
if (empty($num)) {
$agent_arr[$k]['houses_id'] = $houses_id;
$agent_arr[$k]['agents_id'] = $v;
$agent_arr[$k]['type'] = $type;
}
}
$res = $this->insertAll($agent_arr);
return $res;
}
/**
* 解除经纪人和楼盘关系
*
* @param $id
* @param $houses_id
* @return bool|false|int
* @param $type
* @return GHousesToAgents|bool
*/
public function del($id, $houses_id)
public function del($id, $houses_id, $type)
{
if ($id) {
$res = $this->save([ 'is_del' => 1 ], [ 'agents_id' => $id, 'houses_id' => $houses_id ]);
$where['agents_id'] = $id;
$where['houses_id'] = $houses_id;
$where['type'] = $type;
$res = $this->where($where)->update([ 'is_del' => 1 ]);
} else {
$res = false;
}
......@@ -277,8 +309,12 @@ class GHousesToAgents extends BaseModel
*/
public function getHousesUpdateAgents($houses_id)
{
$select_data = $this->field('b.id,name,a.type,b.phone')->alias('a')
$select_data = $this
->field('b.id,name,a.type,b.phone,c.store_name,d.district_name')
->alias('a')
->join('a_agents b', 'a.agents_id = b.id', 'LEFT')
->join("a_store c", "b.store_id = c.id", "left")
->join('a_district d', 'b.district_id = d.id', 'left')
->where([
'houses_id' => $houses_id,
'type' => 2,
......@@ -336,12 +372,18 @@ class GHousesToAgents extends BaseModel
/**
* @param $data
* @return array|false
* @throws \Exception
* @return mixed
*/
public function updateUserAll($data)
{
return $this->saveAll($data);
try {
$data['data'] = $this->saveAll($data);
$data['status'] = 'successful';
} catch (\Exception $e) {
$data['status'] = 'fail';
$data['msg'] = $e->getMessage();
}
return $data;
}
/**
......@@ -376,4 +418,38 @@ class GHousesToAgents extends BaseModel
->where('a.agents_id', $agent_id)
->count();
}
/**
* @param $field
* @param $type
* @param $houses_id
* @param int $is_del
* @return array
*/
public function getAgentHouseOne($field, $type, $houses_id, $is_del = 0) {
$where['is_del'] = $is_del;
$where['type'] = $type;
$where['houses_id'] = $houses_id;
return $this->where($where)
->column($field);
}
/**
* @param $field
* @param $where
* @return mixed
*/
public function getAgentHouseAll($field, $where) {
try {
$data['data'] = $this->field($field)
->where($where)
->select();
$data['status'] = 'successful';
} catch (\Exception $e) {
$data['data'] = [];
$data['status'] = 'fail';
}
return $data;
}
}
......@@ -27,7 +27,8 @@ class MPushMessage
* @param $type
* @return bool
*/
public function addData($data, $operation_id, $type) {
public function addData($data, $operation_id, $type)
{
if (isset($data['agent_id'])) {
$insert_data['addressee_id'] = $data['agent_id'];
}
......@@ -61,6 +62,7 @@ class MPushMessage
return $result;
}
/**
* 根据楼盘id批量插入数据
*
......@@ -70,37 +72,27 @@ class MPushMessage
* @param $data
* @return bool
*/
public function addHouseIdArray(array $house_id, int $type, $data)
public function addHouseIdArray(array $house_id, $operation_id, int $type, $data)
{
if (!is_array($house_id)) {
return false;
}
$m_house = new GHouses();
$insert_data = [];
foreach ($house_id as $k => $v) {
$agent_id = $this->selectAgentHouse($v);
foreach ($agent_id as $k2=>$v2) {
$insert_data[$k2]['house_id'] = $v;
if (isset($data['message'])) {
$insert_data[$k2]['message'] = $data['message'];
}
if (isset($data['user_id'])) {
$insert_data[$k2]['user_id'] = $data['user_id'];
}
if (isset($data['addressee_id'])) {
$insert_data[$k2]['addressee_id'] = $data['addressee_id'];
}
foreach ($agent_id as $k2 => $v2) {
$insert_data[$k2]['house_id'] = $v;
$internal_title = $m_house->where('id', $v)->value('internal_title');
$insert_data[$k2]['message'] = '你的【' . $internal_title . '】商铺下架,如需要上架,请编辑提交该商铺.';
$insert_data[$k2]['addressee_id'] = $v2;
$insert_data[$k2]['type'] = $type;
$insert_data[$k2]['status'] = 0;
$insert_data[$k2]['operation_id'] = $v2;
$insert_data[$k2]['operation_id'] = $operation_id;
}
}
$num = $this->db_->insertAll($insert_data);
......@@ -163,19 +155,60 @@ class MPushMessage
* @param $house_id
* @return array
*/
public function selectAgentHouse($house_id) {
$m_house = new GHousesToAgents();
public function selectAgentHouse($house_id)
{
$m_house = new GHousesToAgents();
$where['a.houses_id'] = $house_id;
$where['a.type'] = 2;
$result = $m_house->getHouseAgent('agents_id', $where);
$result = $m_house->getHouseAgent('agents_id', $where);
$data = [];
$agent_id = [];
if ($result['status'] != 'fail') {
foreach ($result['agents_id'] as $k=>$v) {
$data[] = $v;
foreach ($result['data'] as $k => $v) {
$agent_id[] = $v['agents_id'];
}
}
return $data;
return $agent_id;
}
/**
* 获取指定条数
*
* @param $field
* @param $where
* @param $limit
* @return mixed
*/
public function getDateLimit($field, $where, $limit)
{
try {
$result['data'] = $this->db_->field($field)
->where($where)
->limit($limit)
->select();
$result['status'] = 'successful';
} catch (\Exception $e) {
$result['status'] = 'fail';
$result['msg'] = $e->getMessage();
}
return $result;
}
/**
* @param $data
* @param $where
* @return int|string
*/
public function updateData($data, $where) {
try {
$this->db_->where($where)->update($data);
$result['status'] = 'successful';
} catch (\Exception $e) {
$result['status'] = 'fail';
$result['msg'] = $e->getMessage();
}
return $result;
}
}
\ No newline at end of file
......@@ -4,6 +4,7 @@ namespace app\model;
use app\task\controller\ResultsSummaryNewTask;
use think\Db;
use think\Log;
use think\Model;
/**
......@@ -741,7 +742,49 @@ class OBargainModel extends Model
// echo $this->getLastSql();
return $return;
}
public function getAddBargainNumV2($params, $type)
{
$where_ = [];
$field = "";
$join = [];
if ($type == 1) {
$field = "sum(scale_fee) as num";
} elseif ($type == 2) {
$field = "sum(practical_fee) as num";
} elseif ($type == 3) {
$field = "count(1) as num";
//$where_["trade_type"] = 10;//产品要求统计数量必须是出租类型的180620
$where_["role"] = 3;//必须是反签方
array_push($join, [ ' o_report c', 'a.report_id=c.id', 'left' ]);
}
if (isset($params["agent_id"])) {
$where_["a.agent_id"] = $params["agent_id"];
}
if (isset($params["agent_id"]) && $type == 3) {
unset($where_["agent_id"]);
$where_["c.report_agent_id"] = $params["agent_id"];
}
if (isset($params["create_time"])) {
$where_["a.create_time"] = $params["create_time"];
}
if (isset($params["house_ids"])) {
$where_["b.house_id"] = array( "in", $params["house_ids"] );
array_push($join, [ ' o_order b', 'a.order_id = b.id', 'left' ]);
}
$return = Db::table($this->table)
->field($field)
->alias("a")
->join($join)
->where($where_)
->select();
// echo $this->getLastSql();
Log::write($this->getLastSql(), '本月完成单数-7151'); //记录日志
return $return;
}
/**
* @param $params
* @return false|\PDOStatement|string|\think\Collection
......
......@@ -94,9 +94,21 @@ class Regions extends Model
public function getRegionsCitySH($code) {
$data = [];
$city_data = $this->field('code,fullName')->where('parentCode in ( '.$code.')')->select();
$business = new GBusinessDistrict();
$all_arr[0]['id'] = 0;
$all_arr[0]['name'] = '全部';
foreach ($city_data as $k=>$v) {
$data[$k]['name'] = $v['fullName'];
$data[$k]['city'] = $this->where('parentCode',$v['code'])->column('fullName');
//区和商圈
foreach ($data[$k]['city'] as $k2=>$v2) {
$data[$k]['business_district'][$k2]['district'] = $v2;
$business_arr = $business->field('id,name')->where('city',$v['fullName'])->where('disc', $v2)->select();
$data[$k]['business_district'][$k2]['business'] = array_merge($all_arr, $business_arr);
}
}
return $data;
}
......
......@@ -313,6 +313,12 @@ class Users extends Model
if ($id && $id > 0) {
//修改
$insert_data['update_time'] = date('Y-m-d H:i:s');
if ($data['referrer_id'] == "0") {
$insert_data['referrer_id'] = 0;
$insert_data['referrer_source'] = 0;
}
$this->save($insert_data, [ 'id' => $id ]);
$return_id = $id;
} else {
......@@ -578,12 +584,25 @@ class Users extends Model
/**
* 普通跟进,对客户状态进行更新
*
* @param string $conditions
* @return int|string
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function update_user_status($conditions = '')
{
return db('u_users')->update($conditions);
}
/**
* @param string $params
* @param $pagesize
* @param $pagenum
* @return mixed
* @throws \think\Exception
* @throws \think\exception\DbException
*/
public function all_user($params = '', $pagesize, $pagenum)
{
return db('u_users')
......@@ -597,6 +616,17 @@ class Users extends Model
->select();
}
/**
* @param $field
* @param $params
* @param $pageNo
* @param $pageSize
* @param string $order
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function selectUserList($field, $params, $pageNo, $pageSize, $order = " id desc")
{
$result = Db::table($this->table)
......
......@@ -162,8 +162,8 @@ Route::group('index', [
//商铺
'BusinessList' => [ 'index/BusinessDistrict/getBusiness', [ 'method' => 'get' ] ], //获取商圈
'getBusinessAll' => [ 'index/BusinessDistrict/getBusinessAll', [ 'method' => 'get' ] ], //获取商圈,不带分页
'houseEdit' => [ 'index/Houses/edit', [ 'method' => 'get|post' ] ], //编辑商铺
'houseAdd' => [ 'index/Houses/edit', [ 'method' => 'get' ] ], //新增商铺
'houseEdit' => [ 'index/Houses/editV2', [ 'method' => 'get|post' ] ], //编辑商铺
'houseAdd' => [ 'index/Houses/editV2', [ 'method' => 'get' ] ], //新增商铺
'houseDel' => [ 'index/Houses/del', [ 'method' => 'post' ] ], //删除商铺
'regions' => [ 'index/BusinessDistrict/regions', [ 'method' => 'get' ] ], //获取省市区数据
......@@ -444,7 +444,10 @@ Route::group('task', [
'defaultFollowUp' => [ 'task/PrivacyNumber/defaultFollowUp', [ 'method' => 'post | get' ] ], //默认跟进
'updateShopTask' => [ 'task/JobTask/updateShopTask', [ 'method' => 'post | get' ] ] //默认跟进
'updateShopTask' => [ 'task/JobTask/updateShopTask', [ 'method' => 'post | get' ] ], //默认跟进
'updateShopImageIdTask' => [ 'task/JobTask/updateShopImageIdTask', [ 'method' => 'post | get' ] ], //默认图片
'push' => [ 'task/PushMessageTask/push', [ 'method' => 'get' ] ] //推送
]);
Route::group('broker', [
......
<?php
namespace app\task\controller;
use app\index\service\ImageDepotService;
use app\model\GHouses;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/9/4
* Time : 10:37
* Intro:
*/
class JobTask
{
private $gHouseModel;
public function __construct()
{
$this->gHouseModel = new GHouses();
}
public function updateShopTask()
{
set_time_limit(0); // 取消脚本运行时间的超时上限
$field = "id,disc,business_district_id,shop_area_start,shop_area_end,industry_type,shop_type,update_time";
$params = [];
$total = $this->gHouseModel->getHouseListTotal($params);
$pageSize = 200;
$pageTotal = ceil($total / $pageSize);
for ($pageNo = 1; $pageNo <= $pageTotal; $pageNo++) {
$houseList = $this->gHouseModel->getShopList($field, $params, $pageNo, $pageSize);
$houseArr = [];
foreach ($houseList as $item) {
$houseBin["id"] = $item["id"];
$industry_type = $item["industry_type"];
if ($item["business_district_id"] == 0) {
$area = $item["shop_type"] == 1 ? $item["shop_area_start"] . '㎡' . $industry_type :
$item["shop_area_start"] . '-' . $item["shop_area_end"] . '㎡';
$houseBin["external_title"] = $item["disc"] . $area;
}
if ($item["shop_type"] == 1) {
$industry_type = preg_replace("/餐饮美食/", "沿街餐饮", $industry_type);
} else {
$industry_type = preg_replace("/餐饮美食/", "商场美食", $industry_type);
}
$industry_type = preg_replace("/服装/", "服装鞋包", $industry_type);
$industry_type = preg_replace("/百货零售/", "百货超市", $industry_type);
$houseBin["industry_type"] = $industry_type;
$houseBin["update_time"] = $item["update_time"];
array_push($houseArr, $houseBin);
}
$this->gHouseModel->updateHouse($houseArr);
}
}
public function updateShopImageIdTask()
{
set_time_limit(0); // 取消脚本运行时间的超时上限
$image = new ImageDepotService();
$field = "id,industry_type,update_time";
$params = [];
$total = $this->gHouseModel->getHouseListTotal($params);
$pageSize = 200;
$pageTotal = ceil($total / $pageSize);
for ($pageNo = 1; $pageNo <= $pageTotal; $pageNo++) {
$houseList = $this->gHouseModel->getShopList($field, $params, $pageNo, $pageSize);
$houseArr = [];
foreach ($houseList as $item) {
$industry_type = explode(',', $item['industry_type']);
$houseBin['external_image_id'] = $image->getImage($industry_type[0]);
$houseBin["id"] = $item["id"];
$houseBin["update_time"] = $item["update_time"];
array_push($houseArr, $houseBin);
}
$this->gHouseModel->updateHouse($houseArr);
}
}
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/9/6
* Time: 14:50
*/
namespace app\task\controller;
use app\api_broker\service\PushMessageService;
class PushMessageTask
{
/**
* 定时推送
*/
public function push() {
$push = new PushMessageService();
$push->pushRecord();
}
}
\ No newline at end of file
......@@ -20,7 +20,6 @@ class UpdateShopStatusTask
{
private $shopModel;
public $house_id = [];
function __construct()
{
$this->shopModel = new GHouses();
......@@ -54,7 +53,7 @@ class UpdateShopStatusTask
$params = [];
$time_ = date('Y-m-d', strtotime("-$day day"));
$params["status"] = 1;
$params["update_time"] = array( 'lt', $time_ . " 23:59:59" );
$params["update_time"] = [ 'lt', $time_ . " 23:59:59" ];
$params["is_exclusive_type"] = 0;
//所有修改时间大于10天的商铺
......@@ -63,9 +62,9 @@ class UpdateShopStatusTask
$orderModel = new OrderModel();
$followMole = new GHousesFollowUp();
$select_["create_time"] = array( "between", array( $time_, date("Y-m-d H:i:s", time()) ) );
$select_["create_time"] = [ "between", [ $time_, date("Y-m-d H:i:s", time()) ] ];
$update_arr = [];
$update_arr = $house_id = [];
foreach ($result as $key => $item) {
$select_["house_id"] = $item["id"];
......@@ -76,14 +75,13 @@ class UpdateShopStatusTask
if (!$is_ok && !$is_follow) {
$update_arr[$key]["id"] = $item["id"];
$update_arr[$key]["status"] = 2;
$this->house_id[] = $item['id'];
$house_id[] = $item['id'];
}
}
if (count($update_arr) > 0) {
$this->shopModel->updateHouse($update_arr);
$this->recordPushMessage($house_id);
}
}
/**
......@@ -94,17 +92,21 @@ class UpdateShopStatusTask
$field = "id,residue_num";
$params = [];
$params["status"] = 1;
$params["residue_num"] = array( "lt", 1 );
$params["residue_num"] = [ "lt", 1 ];
$result = $this->shopModel->getShopListByNum($field, $params);
$update_arr = [];
$update_arr = $house_id = [];
foreach ($result as $k => $item) {
$update_arr[$k]["id"] = $item["id"];
$update_arr[$k]["status"] = 2;
$this->house_id[] = $item['id'];
$house_id[] = $item['id'];
}
if (count($update_arr) > 0) {
$this->shopModel->updateHouse($update_arr);
$this->recordPushMessage($house_id);
}
$this->shopModel->updateHouse($update_arr);
}
/**
......@@ -113,11 +115,11 @@ class UpdateShopStatusTask
private function updateStatusByPact()
{
$field = "a.id";
$params = [];
$params = $house_id = [];
$time_ = date('Y-m-d', time());
$params["status"] = 1;
$params["is_exclusive_type"] = 1;
$params["agent_end_time"] = array( 'lt', $time_ );
$params["agent_end_time"] = [ 'lt', $time_ ];
$result = $this->shopModel->getShopListByPact($field, $params);
......@@ -125,23 +127,20 @@ class UpdateShopStatusTask
foreach ($result as $key => $item) {
$update_arr[$key]["id"] = $item["id"];
$update_arr[$key]["status"] = 2;
$this->house_id[] = $item['id'];
$house_id[] = $item['id'];
}
if (count($update_arr) > 0) {
$this->shopModel->updateHouse($update_arr);
$this->recordPushMessage($house_id);
}
}
/**
* 记录需要推送的消息
*/
public function recordPushMessage() {
public function recordPushMessage($house_id)
{
$push_service = new PushMessageService();
$push_service->record(1, $this->house_id, 0, 0);
$push_service->record(1, $house_id, 0, 0);
}
// public function __destruct() {
// $this->recordPushMessage();
// }
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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