Commit 5043dbea authored by clone's avatar clone

Merge branch '0618-v3.3.2' into test

# Conflicts: # application/api_broker/controller/User.php # application/api_broker/service/DailyPaperService.php # application/app_broker/view/index/daily_achieve_mdzj.html # application/index/service/OfficeRoomService.php # application/index/service/UserService.php # application/index/view/finance/account_statement.html # application/index/view/finance/refundList.html # public/app/js/daily_achieve_mdzj.js # public/resource/js/getCollectionShop.js
parents b5a06335 52e743e5
......@@ -133,7 +133,7 @@ class OfficeBroker extends Basic
$list = [];
$agents = new AAgents();
$m_march = new OMarchInModel();
$m_march = new OfficeOMarchInModel();
$m_evaluate = new Evaluate();
//查找30天带看最多的人
......@@ -174,11 +174,11 @@ class OfficeBroker extends Basic
$where['a.id'] = ['neq', $list[1]['id']];
}
$where['b.houses_id'] = $this->params['house_id'];
$where['b.house_id'] = $this->params['house_id'];
$where['b.is_del'] = $where['a.status'] = 0;
$where['b.type'] = 2;
$house_agent = $agents->getAgentHouseType($fields, $where);
$house_agent = $agents->getAgentHouseTypeByOffice($fields, $where);
if (!empty($house_agent)){
$house_agent['show_content'] = '本铺由我登记,熟悉房源信息';
array_push($list, $house_agent);
......
<?php
namespace app\api\controller;
use app\api\extend\Basic;
use app\index\service\OfficeService;
use think\Request;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2019-06-19
* Time: 14:38:58
*/
class OfficeBuilding extends Basic
{
private $service;
public function __construct(Request $request = null)
{
parent::__construct($request);
$this->service = new OfficeService();
}
/**
* 办公楼详情
* @return \think\Response
*/
public function getOfficeBuildingInfo()
{
$params = $this->params;
$checkResult = $this->validate($params, "OfficeRoomValidate.getOfficeRoomInfo");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$id = $params['id'];
$result = $this->service->getBuildingInfo($id,1);
return $this->response($result['status'], $result['msg'], $result['data']);
}
}
\ No newline at end of file
<?php
namespace app\api\controller;
use app\api\extend\Basic;
use app\api\service\ActivityService;
use app\api\service\OfficeRoomApiService;
use app\index\service\OfficeRoomService;
use app\model\MetroStations;
use app\model\OfficeGLabels;
use app\model\Regions;
use think\Request;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2019-06-19
* Time: 14:38:58
*/
class OfficeRoom extends Basic
{
private $service;
private $serviceApi;
public function __construct(Request $request = null)
{
parent::__construct($request);
$this->service = new OfficeRoomService();
$this->serviceApi = new OfficeRoomApiService();
}
/**
* 房源详情
* @return \think\Response
*/
public function getOfficeRoomInfo()
{
$params = $this->params;
$checkResult = $this->validate($params, "OfficeRoomValidate.getOfficeRoomInfo");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$id = $params['id'];
$result = $this->service->getOfficeRoomInfo($id,1,1);
return $this->response($result['status'],$result['msg'], $result['data']);
}
/**
* 楼盘列表
*
* @return \think\Response
*/
public function getBuildingRoomList()
{
$result = $this->serviceApi->getRoomBuildingList($this->params);
if ($result['status'] == 'successful') {
return $this->response("200", "success",$result['data']);
} else {
return $this->response("101", $result['msg']);
}
}
/**
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function filtrateConditionRoom()
{
$params = $this->params;
if (empty($params["city"])) {
return $this->response("101", "参数错误");
}
$city = $params["city"];
$regions = new Regions();
$cityList = $regions->getRegionsByCity($city);
$i = $j = 0;
$result["area"][$i]["city"] = "全部";
$result["area"][$i]["disc"][] = "全部";
foreach ($cityList as $k => $v) {
$i++;
if (!empty($v["name"])) {
$result["area"][$i]["city"] = $v["name"];
$result["area"][$i]["disc"][] = "全" . $v["name"];
}
foreach ($v["city"] as $item) {
if (!empty($item)) {
$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;
}
$metroStations = new MetroStations();
$stationsParams["is_del"] = 0;
$stationsParams["province"] = array("like", trim($city) . "%");
$stationsField = "id,line_name,line_name_simple,name,province,city,latitude,longitude";
$stationsArr = $metroStations->getMetroStations($stationsField, $stationsParams);
$x = $y = 0;
$result["stations"][$x]["line"] = "全部";
$refer = array();
foreach ($stationsArr as $key => $value) {
$refer[$value["line_name_simple"]][] = $value;
}
foreach ($refer as $key => $data) {
$result["stations"][$x]["line"] = $key;
$result["stations"][$x]["name"] = $data;
$x++;
}
//租金租金(0:租金-大于三万; 1:租金一万到三万之间; 2:租金-小于一万)
$result['money'] = array(
array('id' => '-1', 'value' => '全部'), array('id' => '0', 'value' => '3万以上'),
array('id' => '1', 'value' => '1万-3万'), array('id' => '2', 'value' => '1万以下')
);
//面积
$result['acreage'] = array(
array('id' => '-1', 'value' => '全部'), array('id' => '0', 'value' => '30m²以内'),
array('id' => '1', 'value' => '30-60m²'), array('id' => '2', 'value' => '60-100m²'), array('id' => '3', 'value' => '100-300m²')
, array('id' => '4', 'value' => '300-500m²'), array('id' => '5', 'value' => '500m²以上')
);
$result['more'][] = "全部";
$room_labels = new OfficeGLabels();
$labelsResult = $room_labels->getLabels();
if (count($labelsResult) > 0) {
foreach ($labelsResult as $labelsKey => $labelsVal) {
if ($labelsVal['name']) {
$result['more'][] = $labelsVal['name'];
}
}
}
return $this->response("200", "request success", $result);
}
}
\ No newline at end of file
......@@ -73,6 +73,9 @@ class Basic extends Controller
"api/addUserCallAgentV2",
"office/filtrateConditionRoom",
"office_api/getBroker",
"office_api/getOfficeRoomInfo",
"office_api/getBuildingRoomList",
"office_api/filtrateConditionRoom",
);
/**
......
<?php
namespace app\api\service;
use app\model\OfficeGBuildingStations;
use app\model\OfficeGImg;
use app\model\OfficeGRoom;
/**
* Created by PhpStorm.
* User: zw
* Date: 2019/6/25
* Time: 10:31
*/
class OfficeRoomApiService
{
private $m_office_room;
public function __construct()
{
$this->m_office_room = new OfficeGRoom();
}
/**
* 办公楼列表
*
* @param $params
* @return array
*/
public function getRoomBuildingList($params)
{
$page_no = empty($params['pageNo']) ? 1 : $params['pageNo'];
$page_size = empty($params['pageSize']) ? 15 : $params['pageSize'];
$where = [];
$order = 'a.id desc';
if (isset($params['city'])) {
$where['b.city'] = $params['city']; //市
}
if (isset($params['disc'])) {
$where['b.disc'] = $params['disc']; //区
}
if (isset($params['id'])) {
$where['a.id'] = $params['id']; //楼盘id
}
if (isset($params['title'])) {
$where['b.title'] = ['LIKE', '%' . $params['title'] . '%']; //楼盘名
}
if (isset($params['address'])) {
$where['b.address'] = ['LIKE', '%' . $params['address'] . '%']; //楼盘地址
}
if (isset($params['business_id'])) {
$where['b.business_district_id'] = $params['business_id']; //商圈id
}
if (isset($params['area_start'])) {
$where['a.area'] = ['>', $params['area_start']]; //面积
}
if (isset($params['area_end'])) {
$where['a.area'] = ['<', $params['area_end']]; //面积
}
if (isset($params['area_start']) && $params['area_end']) {
$where['a.area'] = ['between', [$params['area_start'], $params['area_end']]]; //面积
}
if (isset($params['type'])) {
$where['b.type'] = $params['type']; //1.写字楼 2商住两用 3园区 4.洋房 5联合办公 6厂房
}
if (isset($params['price_start'])) {
$where['a.price'] = $params['price_start'] * 100;//租金单价
}
if (isset($params['price_end'])) {
$where['a.price'] = $params['price_end'] * 100;//租金单价
}
if (isset($params['price_start']) && isset($params['price_end'])) {
$where['a.price'] = ['between', [$params['price_start'] * 100, $params['price_end'] * 100]]; //租金单价
}
if (isset($params['price_total_start'])) {
$where['a.price_total'] = ['>', $params['price_total_start'] * 100];//租金总单价
}
if (isset($params['price_total_end'])) {
$where['a.price_total'] = ['<', $params['price_end'] * 100];//租金总单价
}
if (isset($params['price_total_start']) && isset($params['price_total_end'])) {
$where['a.price_total'] = ['between', [$params['price_total_start'] * 100, $params['price_total_end'] * 100]]; //租金总单价
}
if (isset($params['shop_sign']) && $params['shop_sign'] != "全部") { //商铺标签
$shopTagsArr = array_filter(explode(',', $params['shop_sign']));
if (count($shopTagsArr) == 1) {
$where['a.shop_sign'] = array('like', "%" . trim($shopTagsArr[0]) . "%");
} else {
foreach ($shopTagsArr as $key => $val) {
$where['a.shop_sign'][] = array('like', "%" . trim($val) . "%");
}
}
}
if (isset($params['stations_ids'])) {
$ids = $this->getBuildingByStations($params['stations_ids']);
if ($ids) {
$where['b.id'] = array("in", $ids); //地铁
}else{
$result['status'] = 'successful';
$result['msg'] = "request null";
return $result;
}
}
$where['a.is_show'] = 0; //状态 是否显示在c端
$field = 'a.id,b.disc,b.title,b.address,c.name as business_name,a.building_id,a.price,a.price_total,b.status,a.is_rent';
try {
$data = $this->m_office_room->getRoomBuilding($page_no, $page_size, $order, $field, $where);
} catch (\Exception $e) {
$result['status'] = 'fail';
$result['msg'] = $e->getMessage();
return $result;
}
$result_data = [];
$gRoomImgModel = new OfficeGImg();
foreach ($data as $k => $v) {
$tmp['id'] = $v['id'];
$tmp['price'] = empty($v['price']) ? 0 : $v['price'] / 100;
$tmp['price_total'] = empty($v['price_total']) ? 0 : $v['price_total'] / 100;
$tmp['shop_sign'] = $this->getBuildingSign($v['building_id']);
$tmp['status'] = $v['status'];
$tmp['is_rent'] = $v['is_rent'];
$area = $this->MinField($v['building_id'], 'area');
$tmp['title'] = $v['disc'] . ' ' . $v['business_name'] . ' ' . $v['title'] . ' ' . $area . '㎡';
$tmp['api_path'] = CK_IMG_URL . 'images/';
$house_img_where["house_id"] = $v["id"];
$house_img_where["img_type"] = 2;
$tmp["images"] = $gRoomImgModel->getCoverImage('id,img_name', $house_img_where);
$result_data[] = $tmp;
}
$result['status'] = 'successful';
$result['data'] = $result_data;
return $result;
}
/**
* 标签处理
*
* @param $id
* @return string
*/
private function getBuildingSign($id)
{
$field = 'shop_sign';
$where['building_id'] = $id;
$where['status'] = 1;
$res = $this->m_office_room->getRoom($field, $where);
if (!$res)
return '';
$shop_sign_old = '';
foreach ($res as $k => $v) {
$shop_sign_old .= ',' . $v['shop_sign'];
}
$ex_shop_sign_old = explode(',', trim($shop_sign_old, ","));
$ex_shop_sign_old = array_unique($ex_shop_sign_old);//数组去重
$shop_sign = implode(",", $ex_shop_sign_old);
return $shop_sign;
}
//字段最低值
public function MinField($id, $field = '')
{
$where['building_id'] = $id;
$field_string = "min({$field}) as min";
return $this->m_office_room->getFieldOneValue($field_string, $where);
}
/**
* 根据地铁id获取字典id
* @param $stations_str
* @return string
*/
private function getBuildingByStations($stations_str)
{
$buildingStationsModel = new OfficeGBuildingStations();
$field = "building_id,stations_id";
$params["stations_id"] = array("in", $stations_str);
$buildingArr = $buildingStationsModel->getBuilderByStations($field, $params);
$ids = "";
if (count($buildingArr) > 0) {
foreach ($buildingArr as $item) {
$ids .= $item["building_id"] . ",";
}
$ids = rtrim($ids, ",");
}
return $ids;
}
}
<?php
/**
* Created by fuju
* User : hj
* Date : 2017-12-7
* Time : 15:15:42
* Intro:
*/
namespace app\api\validate;
use think\Validate;
class OfficeRoomValidate extends Validate {
protected $rule = [
'id' => 'require|number|gt:0',
];
protected $message = [
'id.require' => 'id为必填字段',
'id.number' => 'id只能为数字',
'id.gt' => 'id必须大于0',
];
protected $scene = [
'getOfficeRoomInfo' => [ 'id' ],
];
}
\ No newline at end of file
......@@ -13,6 +13,7 @@ use app\model\AAgents;
use app\model\GHouses;
use app\model\GHousesFollowUp;
use app\model\OfficeGHousesFollowUp;
use app\model\OfficeGRoom;
use app\model\OfficeUPhoneFollowUp;
use app\model\ULabels;
use app\model\UPhoneFollowUp;
......@@ -176,14 +177,14 @@ class OfficeHomePageLog extends Basic
{
$params = $this->params;
/*$params = array(
"start_time" => strtotime('2016-08-14 11:02:36'), //开始时间
"end_time" => strtotime('2018-08-14 11:07:10'), //结束时间
"name_or_phone" => "18112347151",//用户姓名或电话
"search_content" => "1",// 搜索跟进内容
"pageNo" => 1,
"pageSize" => 15
);*/
// $params = array(
// "start_time" => strtotime('2019-06-01 11:02:36'), //开始时间
// "end_time" => strtotime('2019-06-26 12:07:10'), //结束时间
//"name_or_phone" => "18112347151",//用户姓名或电话
// "search_content" => "1",// 搜索跟进内容
// "pageNo" => 1,
// "pageSize" => 15
// );
if (empty($params['start_time']) || empty($params['end_time'])) {
return $this->response("101", '请选择时间');
......@@ -261,14 +262,6 @@ class OfficeHomePageLog extends Basic
$order = "f.id desc";
$result = $this->gHouseFollowUpModel->getSearch($pageNo, $pageSize, $order, $field, $where_, "");
foreach ($result as $key => $value) {
// $agent_params = [];
// $agent_params["a.id"] = $value['agent_id'];
// $agent_field = "a.name,a.img,b.store_name";
// $model = new AAgents();
// $res_a = $model->getAgentsInfo($agent_field, $agent_params);
// $result[$key]['name'] = $res_a[0]['name'];
// $result[$key]['img'] = $res_a[0]['img'];
// $result[$key]['store_name'] = $res_a[0]['store_name'];
if ($value['agent_id']) {
$agent_data = $redis_service->getRedisCache(2, $value['agent_id']);
$result[$key]['name'] = $agent_data['name'];
......@@ -279,16 +272,12 @@ class OfficeHomePageLog extends Basic
$result[$key]['img'] = [];
$result[$key]['store_name'] = [];
}
$house_params = [];
$house_params["id"] = $value['house_id'];
$house_field = "internal_title";
$model = new GHouses();
$res_a = $model->getHouseInfo($house_field, $house_params);
$result[$key]['internal_title'] = $res_a[0]['internal_title'];
$roomModel = new OfficeGRoom();
$house_params["a.id"] = $value['house_id'];
$res_a = $roomModel->getHouseInfo("a.id,CONCAT(b.address,a.room_number) internal_address", $house_params);
$result[$key]['internal_title'] = $res_a[0]['internal_address'];
}
//$count = $this->gHouseFollowUpModel->getSearchCount( $where_);
if (count($result) > 0) {
$list["result"] = $result;
$list["img_path"] = AGENTHEADERIMGURL;
......
......@@ -396,27 +396,6 @@ class OfficeOrderLog extends Basic{
return $this->response("200", "request success", $data);
}
/**
* 报备时间轴
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function selectReportAllV2()
{
$params = $this->params;
/* $params = array(
"order_id" => 38024,
);*/
if (!isset($params["order_id"])) {
return $this->response("101", "请求参数错误");
}
$data = $this->service_->selectListByOrderNo($params["order_id"]);
return $this->response("200", "request success", $data);
}
/**
* 修改成单状态
......
......@@ -45,7 +45,7 @@ class RankingList extends Basic{
if($agent_info["position"] == 5){
return $this->response("101","该经纪人没有分配职称");
}
$result = $this->service_->RankingList( $agent_info["position"],$this->siteId);
$result = $this->service_->RankingList( $agent_info["position"],$this->siteId,1);
$agent_id = $params["agent_id"];
$data = [];
foreach ($result as $key=>$value){
......@@ -89,7 +89,7 @@ class RankingList extends Basic{
if(count($agent_info) <= 0){
return $this->response("101","该经纪人不存在");
}
$result = $this->service_->StoreRankingList( $this->siteId);
$result = $this->service_->StoreRankingList( $this->siteId,1);
$store_id = $agent_info["store_id"];
$data = [];
foreach ($result as $key=>$value){
......
......@@ -94,10 +94,13 @@ class User extends Basic
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
#接口调用类型 0:客户搜索 1:全部客户 2:我的客户
$app_request_source_type = isset($params["app_request_source_type"]) && is_numeric($params["app_request_source_type"])? $params["app_request_source_type"] : 1;
$conditions = [];
switch ($app_request_source_type) {
case 0:
$pageNo = 1;
$pageSize = 50;
if (isset($params['id'])) {
$conditions['id'] = $params['id'];
}
......@@ -135,7 +138,6 @@ class User extends Basic
//委托类型
$conditions['entrust_type'] =$params['entrust_type'];
}
break;
default:
if (isset($params['user_status'])) {
......@@ -210,45 +212,30 @@ class User extends Basic
$conditions['vip'] = $params['is_vip'];
}
//传了经纪人id则表示我的客户
if (isset($params["agent_id"])) {
$conditions['agent_id'] = $params['agent_id'];
//是我的客户就显示全部
}else{
if($app_request_source_type == 1){
#全部客户列表 排除排除纯房东客户
$conditions['user_label'] = array( "neq", 2 );
#根据时间搜索,要能搜到保护期客户
if(!$is_search && !isset($conditions['create_time'])){
#排除排除保护期内的客户 将截止日期大于当前时间的数据排除掉
$time_now = date('Y-m-d H:i:s');
$conditions['protect_time'] = array('lt',$time_now);
}
#站点的客户
if (isset($params['site_id']) ) {
#根据前端选择站点客户
$conditions['site_ids'] = [ 'LIKE', '%' . $params['site_id'] . '%' ];
}else{
#前端不穿站点参数就默认显示经纪人所在站点的客户
$conditions['site_ids'] = [ 'LIKE', '%' . $this->siteId . '%' ];
}
}
//全部客户列表 排除排除纯房东客户
$conditions['user_label'] = array( "neq", 2 );
//根据时间搜索,要能搜到保护期客户
if(!$is_search && !isset($conditions['create_time'])){
//排除排除保护期内的客户 将截止日期大于当前时间的数据排除掉
$time_now = date('Y-m-d H:i:s');
$conditions['protect_time'] = array('lt',$time_now);
}
if (($app_request_source_type == 0) && (!isset($params["agent_id"]))) {
$pageNo = 1;
$pageSize = 50;
//客户站点
if (isset($params['site_id']) ) {
$conditions['site_ids'] = [ 'LIKE', '%' . $params['site_id'] . '%' ];
}else{
$conditions['site_ids'] = [ 'LIKE', '%' . $this->siteId . '%' ];
}
if(isset($params['entrust_type']) && is_numeric($params['entrust_type']) && ($app_request_source_type == 1)){
//委托类型
//委托类型
if(isset($params['entrust_type']) && is_numeric($params['entrust_type'])){
$conditions['entrust_type'] =$params['entrust_type'];
}
}
$field = "id as user_id,sex,user_name,city,user_phone,user_status,agent_id,create_time,industry_type,
price_demand,area_demand,vip,user_label,source_intro,site_ids,entrust_type,concrete_industry";
$return_user_list = $this->userModel->selectUserList($field, $conditions, $pageNo, $pageSize, "id desc");
......@@ -288,6 +275,7 @@ class User extends Basic
$return_user_list[$k]['user_phone'] = substr_replace($return_user_list[$k]['user_phone'], '****', 3, 4);
$return_user_list[$k]['site_ids_name'] = $user_service->userSiteName($v["site_ids"]);
$return_user_list[$k]['user_name'] = $v['user_name'] && $v['entrust_type'] == 0 ?"{$v['concrete_industry']},{$v['user_name']}":$v['user_name'];
}
......@@ -614,7 +602,7 @@ class User extends Basic
return $this->response("201", "查无数据", [ 'user_id' => $params['user_id'] ]);
}
// $model = new AAgents();
// $model = new AAgents();
/* $result = $model->searchAgentsByKeyword("id,name,phone", [ "id" => $params["agent_id"]]);
$call = new CallPhoneService();
$gresult = $call->getBindNum($user_res['user_phone'],$result[0]['phone']);*/
......
......@@ -339,9 +339,9 @@ class DailyPaperService
$info["case_fee"][$k]['current_agent_name'] = $current_agent_name;
}
}
$info["case_fee"][$k]['is_check'] = 0;
$info["agency_fee"][$k]['is_check'] = 0;
if ($v["types"] == 1 && $this->openCheckButton($v['id'])) {
$info["case_fee"][$k]['is_check'] = 1;
$info["agency_fee"][$k]['is_check'] = 1;
}
}
......
......@@ -10,6 +10,8 @@ use app\model\GHousesImgs;
use app\model\GHousesToAgents;
use app\model\OBargainModel;
use app\model\OfficeGRoomToAgent;
use app\model\OfficeOBargainModel;
use app\model\OfficeOMarchInModel;
use app\model\OfficeOPayLogModel;
use app\model\OfficeORefundModel;
use app\model\OfficeOReportModel;
......@@ -48,14 +50,71 @@ class OfficePerformanceService
$this->agentModel = new AAgents();
$this->houseModel = new GHouses();
$this->userModel = new Users();
$this->bargainModel = new OBargainModel();
$this->reportModel = new OReportModel();
$this->marchInModel = new OMarchInModel();
$this->payLogModel = new OPayLogModel();
$this->bargainModel = new OfficeOBargainModel();
$this->reportModel = new OfficeOReportModel();
// $this->reportModel = new OReportModel();
$this->marchInModel = new OfficeOMarchInModel();
$this->payLogModel = new OfficeOPayLogModel();
$this->gHousesImgModel = new GHousesImgs();
$this->superviseModel = new ASuperviseModel();
}
/**
* 进场
* @param $id
* @param $type
* @param $start_time
* @param $end_time
* @param $page_no
* @param $page_size
* @return array
*/
public function marchInListPcInfo($id, $type, $start_time, $end_time, $page_no, $page_size)
{
$params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time);
//dump($params);
Log::write($params, 'marchInListPcInfo'); //记录日志
if (!$params)
return [ "code" => 101, "date" => "传入的参数错误" ];
$field = "a.id,c.user_name,c.user_phone,c.predict_see_time,c.report_agent_name,b.house_title,b.create_time,e.store_name,b.id as order_id";
$addMarchInList = $this->marchInModel->getAddMarchInListPcInfo($params, $field, $page_no, $page_size);
$addMarchInListTotal = $this->marchInModel->getAddMarchInListPcInfoTotal($params, $field);
//获取图片信息
foreach ($addMarchInList as $key => $val) {
$addMarchInList[$key]["user_name"] = $val["user_name"] ? $val["user_name"] : '';
$addMarchInList[$key]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $val["user_phone"]);
}
return [ "code" => 200, "date" => $addMarchInList, "total" => $addMarchInListTotal ];
}
/**
* 报备
* @param $id
* @param $type
* @param $start_time
* @param $end_time
* @param $page_no
* @param $page_size
* @return array
*/
public function getFollowListPcInfo($id, $type, $start_time, $end_time, $page_no, $page_size)
{
$params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time);
if (!$params)
return [ "code" => 101, "date" => "传入的参数错误" ];
$field = "a.id,a.user_name,a.user_phone,a.predict_see_time,a.create_time,a.report_agent_name,d.title as house_title,d.type,e.store_name,b.id as order_id";
$reportList = $this->reportModel->getAddReportListPcInfo($params, $field, $page_no, $page_size);
$reportListTotal = $this->reportModel->getAddReportListPcInfoTotal($params, $field);
foreach ($reportList as $key => $val) {
$reportList[$key]["user_name"] = $val["user_name"] ? $val["user_name"] : '';
$reportList[$key]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $val["user_phone"]);
}
//return [ "code" => 200, "date" => $reportList ];
return [ "code" => 200, "date" => $reportList, "total" => $reportListTotal ];
}
/**
* @param $agent_id
* @param $type
......@@ -699,7 +758,8 @@ class OfficePerformanceService
$params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time);
if (!$params)
return [ "code" => 101, "date" => "传入的参数错误" ];
$field = "a.id,a.create_time,a.money,a.type,a.pay_type,c.user_name,c.user_phone,c.predict_see_time,b.id as order_id,b.house_title,h.internal_address";
$field = "a.id,a.create_time,a.money,a.type,a.pay_type,c.user_name,c.user_phone,c.predict_see_time,
b.id as order_id,s.title as house_title,s.address as internal_address";
$payLogList = $this->payLogModel->getAddPayLogListPcInfo($params, $field, $page_no, $page_size);
//获取图片信息
foreach ($payLogList as $key => $val) {
......@@ -710,34 +770,7 @@ class OfficePerformanceService
return [ "code" => 200, "date" => $payLogList ];
}
/**
* 进场
* @param $id
* @param $type
* @param $start_time
* @param $end_time
* @param $page_no
* @param $page_size
* @return array
*/
public function marchInListPcInfo($id, $type, $start_time, $end_time, $page_no, $page_size)
{
$params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time);
//dump($params);
Log::write($params, 'marchInListPcInfo'); //记录日志
if (!$params)
return [ "code" => 101, "date" => "传入的参数错误" ];
$field = "a.id,c.user_name,c.user_phone,c.predict_see_time,c.report_agent_name,b.house_title,b.create_time,e.store_name,b.id as order_id";
$addMarchInList = $this->marchInModel->getAddMarchInListPcInfo($params, $field, $page_no, $page_size);
$addMarchInListTotal = $this->marchInModel->getAddMarchInListPcInfoTotal($params, $field);
//获取图片信息
foreach ($addMarchInList as $key => $val) {
$addMarchInList[$key]["user_name"] = $val["user_name"] ? $val["user_name"] : '';
$addMarchInList[$key]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $val["user_phone"]);
}
return [ "code" => 200, "date" => $addMarchInList, "total" => $addMarchInListTotal ];
}
/**
......@@ -813,32 +846,7 @@ class OfficePerformanceService
}
/**
* 报备
* @param $id
* @param $type
* @param $start_time
* @param $end_time
* @param $page_no
* @param $page_size
* @return array
*/
public function getFollowListPcInfo($id, $type, $start_time, $end_time, $page_no, $page_size)
{
$params = $this->getAgentIdPcInfo($id, $type, $start_time, $end_time);
if (!$params)
return [ "code" => 101, "date" => "传入的参数错误" ];
$field = "a.id,a.user_name,a.user_phone,a.predict_see_time,a.create_time,a.report_agent_name,c.internal_title as house_title,c.shop_type,e.store_name,b.id as order_id";
$reportList = $this->reportModel->getAddReportListPcInfo($params, $field, $page_no, $page_size);
$reportListTotal = $this->reportModel->getAddReportListPcInfoTotal($params, $field);
foreach ($reportList as $key => $val) {
$reportList[$key]["user_name"] = $val["user_name"] ? $val["user_name"] : '';
$reportList[$key]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $val["user_phone"]);
}
//return [ "code" => 200, "date" => $reportList ];
return [ "code" => 200, "date" => $reportList, "total" => $reportListTotal ];
}
/**
......@@ -889,9 +897,9 @@ class OfficePerformanceService
if (!$params)
return [ "code" => 101, "date" => "传入的参数错误" ];
$field = "a.id,a.father_id,a.create_time,a.trade_type,a.scale_fee,a.agent_id,c.internal_address,d.user_phone,d.user_name,b.id as order_id";
$m_bargain = new OBargainModel();
$list = $m_bargain->getBargainSumList($field, $params, $page_size, $page_no, $request_source_type);
$field = "a.id,a.father_id,a.create_time,a.trade_type,a.scale_fee,a.agent_id,e.address as internal_address,
d.user_phone,d.user_name,b.id as order_id";
$list = $this->bargainModel->getBargainSumList($field, $params, $page_size, $page_no, $request_source_type);
foreach ($list as $key => $val) {
$list[$key]['bargain_id'] = $val["father_id"] == 0 ? $val["id"] : $val["father_id"];//成交报告ID
$list[$key]["internal_address"] = $val["internal_address"] ? $val["internal_address"] : '';
......
......@@ -248,7 +248,7 @@ class StatementService
$end_time = $start_time;
$where_["agent_id"] = $agent_id;
$where_['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
// dump($where_);
// dump($where_);
$performanceSum = $this->bargainModel->getAddBargainNum($where_, 3);//1表示业绩 2表示实收
$result["bargain_sum_store"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
......@@ -260,8 +260,8 @@ class StatementService
$where_["agent_id"] = $agent_id;
$where_['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
//dump($where_);
// $reportNum = $this->reportModel->getAddReportNum($where_);
// $result["look_at_num_day_store"] = isset($reportNum[0]["num"]) ? $reportNum[0]["num"] : 0;
// $reportNum = $this->reportModel->getAddReportNum($where_);
// $result["look_at_num_day_store"] = isset($reportNum[0]["num"]) ? $reportNum[0]["num"] : 0;
$addMarchInNum = $this->marchInModel->getAddMarchInNum($where_);
$result["look_at_num_day_store"] = isset($addMarchInNum[0]["num"]) ? $addMarchInNum[0]["num"] : 0;
......@@ -294,7 +294,7 @@ class StatementService
$where_ = [];
$start_time = date("Y-m-01", time());
$end_time = date("Y-m-d", time());
// $where_["district_id"] = $district_id;
// $where_["district_id"] = $district_id;
$where_["agent_id"] = $conditions["agent_id"];
$where_['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
......@@ -338,7 +338,7 @@ class StatementService
$where_ = [];
$start_time = date("Y-m-01", time());
$end_time = date("Y-m-d", time());
// $where_["district_id"] = $district_id;
// $where_["district_id"] = $district_id;
$where_["agent_id"] = $conditions["agent_id"];
$where_['create_time'] = array( 'between', array( $start_time . " 00:00:00", $end_time . " 23:59:59" ) );
......@@ -405,7 +405,7 @@ class StatementService
$where_['status'] =array( "in", '10, 11, 13, 20' );
$obargain = new OBargainModel();
// dump($where_);
// dump($where_);
$performanceSum = $obargain->getAddBargainNum($where_, 1);//1表示业绩 2表示实收
$store_list["performance_week"] = isset($performanceSum[0]["num"]) ? $performanceSum[0]["num"] : 0;
......@@ -478,7 +478,7 @@ class StatementService
foreach ($results as $key => $value) {
// dump($value);
// dump($value);
$last_week_total += $value["agent_num"];
$paramArr["store_id"] = $value["store_id"];
$paramArr["level"] = array( "in", [ 20, 40 ] );
......
......@@ -178,17 +178,26 @@ class Index
{
return view('index/timeline_pc');
}
public function timeline_pc_office()
{
return view('index/timeline_pc_office');
}
public function bargaininfo_detail_static_pc()
{
return view('index/bargaininfo_detail_static_pc');
}
public function bargaininfo_detail_static_pc_office()
{
return view('index/bargaininfo_detail_static_pc_office');
}
public function submit_report_pc()
{
return view('index/submit_report_pc');
}
public function submit_report_pc_office()
{
return view('index/submit_report_pc_office');
}
public function shop_detail_pc()
{
return view('index/shop_detail_pc');
......
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>同联商业</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
<meta name="Keywords" content="" />
<meta name="Description" content="" />
</head>
<body class="body-pc" style="display: none;">
<div id="app">
<nav class="oh">
<a href="javascript:;" class="btn-pc" @click="tabMain(0)" :class="{'btn-info-pc':mainInit == 0}">成交信息</a>
<a href="javascript:;" class="btn-pc" @click="tabMain(1)" :class="{'btn-info-pc':mainInit == 1}">分佣提成</a>
<a href="javascript:;" class="btn-pc" @click="tabMain(2)" :class="{'btn-info-pc':mainInit == 2}">开票税费</a>
</nav>
<main>
<section v-show="mainInit == 0">
<div class="sec1-area1 oh">
<ul>
<li>
<!--<div>房源类型:</div>
<div>{{detailData.shop_type=='1'?'街铺':'商场'}}</div>-->
</li>
<!--<li v-if='is_office == 2'>
<div>房源类型:</div>
<div>{{detailData.type}}</div>
</li>-->
<li>
<div>楼盘地址:</div>
<div>{{detailData.internal_address}}
<button v-if="otherBtn!='no'" class="btn-pc btn-info-pc btn-show-shop-detail" @click.stop.prevent="showShopDetail">商铺</button>
</div>
</li>
<li>
<div>业态:</div>
<div>{{detailData.industry_type}}</div>
</li>
<li>
<div>客户姓名:</div>
<div>{{detailData.user_name}}</div>
</li>
<li>
<div>成交类型:</div>
<div>{{dealDoneType(detailData.trade_type)}}</div>
</li>
<li>
<div>应收总佣金:</div>
<div>{{detailData.commission}}元</div>
</li>
</ul>
<ul>
<li>
</li>
<li>
<div>楼盘号:</div>
<div>{{detailData.house_number}}</div>
</li>
<li>
<div>预计收款时间:</div>
<div>{{detailData.estimated_receipt_date}}</div>
</li>
<li>
<div>客户电话:</div>
<div>{{hidePhone(detailData.user_phone)}}
<button v-if="otherBtn!='no'" class="btn-pc btn-info-pc btn-show-customer-detail" @click.stop.prevent="showCustomerDetail">客户</button>
</div>
</li>
<li>
<div>成交日期:</div>
<div>{{detailData.create_time}}</div>
</li>
<li>
<div>成交价:</div>
<div>{{detailData.price}}元</div>
</li>
</ul>
</div>
<div class="sec1-area2">
<ul>
<li class="flex" v-for="(item, index) in detailData.practical_fee" :key="index" :data-id="item.fee_id">
<div><span>实收佣金:</span>{{item.money}}元</div>
<div><span>收佣日期:</span>{{item.income_time}}</div>
</li>
</ul>
</div>
<div class="sec1-area3">
<ul>
<li>备注:{{detailData.content}}</li>
</ul>
</div>
</section>
<section v-show="mainInit == 1">
<table class="fenyong-ticheng-main-table">
<thead>
<tr>
<th>分佣ID</th>
<th>分佣方</th>
<th>业务员</th>
<th>所属门店</th>
<th>分佣比例</th>
<th>应分佣金(元)</th>
<th>预分佣金(元)</th>
<th>手续费(元)</th>
<th>慈善基金(元)</th>
<th>现金奖(元)</th>
<th>实收佣金(元)</th>
<th>收佣日期</th>
<th>确认时间</th>
</tr>
</thead>
<tbody v-if="Array.isArray(fenyongData) && fenyongData.length>0">
<tr v-for="(item, index) in fenyongData" :key="index" :data-id="item.id">
<td>{{item.id}}</td>
<td>{{item.role_name}}</td>
<td>{{item.agent}}</td>
<td>{{item.district_store}}</td>
<td class="detail-modal-maid-span-scale">{{item.scale}}%</td>
<td class="detail-modal-maid-td-should-commission">{{item.scale_fee}}</td>
<td colspan="7" class="fenyong-ticheng-mix-td" v-if="item.partial_commission&&item.partial_commission.length&&item.partial_commission.length>0">
<div data-id="354" v-for="(item2, index2) in item.partial_commission">
<span>{{item2.real_fee}}</span>
<span>{{item2.service_charge}}</span>
<span>{{item2.charity_fund}}</span>
<span>{{item2.cash}}</span>
<span>{{item2.practical_fee}}</span>
<span v-if="!item2.income_time||(item2.income_time.length&&item.income_time.length<1)"></span>
<span v-else>{{item2.income_time.income_time}}</span>
<span v-if='item2.confirm_date'>{{item2.confirm_date.split(' ')[0]}}</span>
</div>
</td>
<td colspan="7" class="fenyong-ticheng-mix-td" v-else>
<div>
<span class="detail-modal-maid-span-real-fee"></span>
<span class="detail-modal-maid-span-service-charge">0</span>
<span class="detail-modal-maid-span-charity-fund">0</span>
<span class="detail-modal-maid-span-cash">0</span>
<span class="detail-modal-maid-span-practical-fee"></span>
<span></span>
<span></span>
</div>
</td>
</tr>
</tbody>
<tbody v-else>
<tr>
<td colspan="13">暂无数据</td>
</tr>
</tbody>
<tfoot>
<tr>
<td>合计</td>
<td></td>
<td></td>
<td></td>
<td id="maid_count_total_rate"></td>
<td id="maid_count_total_yingfen"></td>
<td id="maid_count_total_yufen"></td>
<td id="maid_count_total_shouxu"></td>
<td id="maid_count_total_cishan"></td>
<td id="maid_count_total_xianjin"></td>
<td id="maid_count_total_shishou"></td>
<td></td>
<td></td>
</tr>
</tfoot>
</table>
</section>
<section v-show="mainInit == 2">
<div v-if="Array.isArray(shuifeiData) && shuifeiData.length>0">
<table v-for="(item, index) in shuifeiData" class="shuifei-list-table">
<tbody>
<tr>
<td>开票金额</td>
<td>{{item.total_fee}}</td>
<td>开票日期</td>
<td>{{item.operation_date}}</td>
</tr>
<tr>
<td>分佣方</td>
<td>业务员</td>
<td>分佣比例</td>
<td>税费</td>
</tr>
<tr v-for="(item2, index2) in item.fee_list" :data-feeid="item2.fee_id">
<td>{{getInfoType(item2.role)}}</td>
<td>{{item2.name+'-'+item2.phone}}</td>
<td>{{item2.scale}}</td>
<td>{{item2.fee}}</td>
</tr>
</tbody>
</table>
</div>
<div v-else class="tc">暂无数据</div>
</section>
</main>
</div>
<script src="/app/js/libs/require.min.js" data-js="/app/js/bargaininfo_detail_static_pc_office.js" data-main="/app/js/main" data-norem="yes" defer async="true"></script>
</body>
</html>
\ No newline at end of file
......@@ -66,14 +66,14 @@
</tr>
<tr class="shanghai">
<td>商场</td>
<td><input type="number" placeholder="填写" data-alert="上海商场业绩填写完整" class="shanghai-bitian-6"/></td>
<td><input type="text" placeholder="填写" data-alert="上海商场业绩占比填写完整" class="shanghai-bitian-7"/></td>
<td><input type="number" placeholder="填写" data-alert="上海商场业绩填写完整" class="shanghai-bitian-6" v-model.number="shop_yeji_SH"/></td>
<td>{{zhanbi(shop_yeji_SH, office_yeji_SH)}}</td>
<td colspan="2"><input type="number" placeholder="填写" data-alert="上海商场成交单数填写完整" class="shanghai-bitian-8"/></td>
</tr>
<tr class="shanghai">
<td>街铺</td>
<td><input type="number" placeholder="填写" data-alert="上海街铺业绩填写完整" class="shanghai-bitian-9"/></td>
<td><input type="text" placeholder="填写" data-alert="上海街铺业绩占比填写完整" class="shanghai-bitian-10"/></td>
<td><input type="number" placeholder="填写" data-alert="上海街铺业绩填写完整" class="shanghai-bitian-9" v-model.number="office_yeji_SH"/></td>
<td>{{zhanbi(office_yeji_SH, shop_yeji_SH)}}</td>
<td colspan="2"><input type="number" placeholder="填写" data-alert="上海街铺成交单数填写完整" class="shanghai-bitian-11"/></td>
</tr>
<tr class="shanghai">
......@@ -141,14 +141,14 @@
</tr>
<tr class="hangzhou">
<td>商场</td>
<td><input type="number" placeholder="填写" data-alert="杭州商场业绩填写完整" class="hangzhou-bitian-6"/></td>
<td><input type="text" placeholder="填写" data-alert="杭州商场业绩占比填写完整" class="hangzhou-bitian-7"/></td>
<td><input type="number" placeholder="填写" data-alert="杭州商场业绩填写完整" class="hangzhou-bitian-6" v-model.number="shop_yeji_HZ"/></td>
<td>{{zhanbi(shop_yeji_HZ, office_yeji_HZ)}}</td>
<td colspan="2"><input type="number" placeholder="填写" data-alert="杭州商场成交单数填写完整" class="hangzhou-bitian-8"/></td>
</tr>
<tr class="hangzhou">
<td>街铺</td>
<td><input type="number" placeholder="填写" data-alert="杭州街铺业绩填写完整" class="hangzhou-bitian-9"/></td>
<td><input type="text" placeholder="填写" data-alert="杭州街铺业绩占比填写完整" class="hangzhou-bitian-10"/></td>
<td><input type="number" placeholder="填写" data-alert="杭州街铺业绩填写完整" class="hangzhou-bitian-9" v-model.number="office_yeji_HZ"/></td>
<td>{{zhanbi(office_yeji_HZ, shop_yeji_HZ)}}</td>
<td colspan="2"><input type="number" placeholder="填写" data-alert="杭州街铺成交单数填写完整" class="hangzhou-bitian-11"/></td>
</tr>
<tr class="hangzhou">
......@@ -216,14 +216,14 @@
</tr>
<tr class="shenzhen">
<td>商场</td>
<td><input type="number" placeholder="填写" data-alert="深圳商场业绩填写完整" class="shenzhen-bitian-6"/></td>
<td><input type="text" placeholder="填写" data-alert="深圳商场业绩占比填写完整" class="shenzhen-bitian-7"/></td>
<td><input type="number" placeholder="填写" data-alert="深圳商场业绩填写完整" class="shenzhen-bitian-6" v-model.number="shop_yeji_SZ"/></td>
<td>{{zhanbi(shop_yeji_SZ, office_yeji_SZ)}}</td>
<td colspan="2"><input type="number" placeholder="填写" data-alert="深圳商场成交单数填写完整" class="shenzhen-bitian-8"/></td>
</tr>
<tr class="shenzhen">
<td>街铺</td>
<td><input type="number" placeholder="填写" data-alert="深圳街铺业绩填写完整" class="shenzhen-bitian-9"/></td>
<td><input type="text" placeholder="填写" data-alert="深圳街铺业绩占比填写完整" class="shenzhen-bitian-10"/></td>
<td><input type="number" placeholder="填写" data-alert="深圳街铺业绩填写完整" class="shenzhen-bitian-9" v-model.number="office_yeji_SZ"/></td>
<td>{{zhanbi(office_yeji_SZ, shop_yeji_SZ)}}</td>
<td colspan="2"><input type="number" placeholder="填写" data-alert="深圳街铺成交单数填写完整" class="shenzhen-bitian-11"/></td>
</tr>
<tr class="shenzhen">
......@@ -292,14 +292,14 @@
</tr>
<tr class="guangzhou">
<td>商场</td>
<td><input type="number" placeholder="填写" data-alert="广州商场业绩填写完整" class="guangzhou-bitian-6"/></td>
<td><input type="text" placeholder="填写" data-alert="广州商场业绩占比填写完整" class="guangzhou-bitian-7"/></td>
<td><input type="number" placeholder="填写" data-alert="广州商场业绩填写完整" class="guangzhou-bitian-6" v-model.number="shop_yeji_GZ"/></td>
<td>{{zhanbi(shop_yeji_GZ, office_yeji_GZ)}}</td>
<td colspan="2"><input type="number" placeholder="填写" data-alert="广州商场成交单数填写完整" class="guangzhou-bitian-8"/></td>
</tr>
<tr class="guangzhou">
<td>街铺</td>
<td><input type="number" placeholder="填写" data-alert="广州街铺业绩填写完整" class="guangzhou-bitian-9"/></td>
<td><input type="text" placeholder="填写" data-alert="广州街铺业绩占比填写完整" class="guangzhou-bitian-10"/></td>
<td><input type="number" placeholder="填写" data-alert="广州街铺业绩填写完整" class="guangzhou-bitian-9" v-model.number="office_yeji_GZ"/></td>
<td>{{zhanbi(office_yeji_GZ, shop_yeji_GZ)}}</td>
<td colspan="2"><input type="number" placeholder="填写" data-alert="广州街铺成交单数填写完整" class="guangzhou-bitian-11"/></td>
</tr>
<tr class="guangzhou">
......@@ -367,14 +367,14 @@
</tr>
<tr class="beijing">
<td>商场</td>
<td><input type="number" placeholder="填写" data-alert="北京商场业绩填写完整" class="beijing-bitian-6"/></td>
<td><input type="text" placeholder="填写" data-alert="北京商场业绩占比填写完整" class="beijing-bitian-7"/></td>
<td><input type="number" placeholder="填写" data-alert="北京商场业绩填写完整" class="beijing-bitian-6" v-model.number="shop_yeji_BJ"/></td>
<td>{{zhanbi(shop_yeji_BJ, office_yeji_BJ)}}</td>
<td colspan="2"><input type="number" placeholder="填写" data-alert="北京商场成交单数填写完整" class="beijing-bitian-8"/></td>
</tr>
<tr class="beijing">
<td>街铺</td>
<td><input type="number" placeholder="填写" data-alert="北京街铺业绩填写完整" class="beijing-bitian-9"/></td>
<td><input type="text" placeholder="填写" data-alert="北京街铺业绩占比填写完整" class="beijing-bitian-10"/></td>
<td><input type="number" placeholder="填写" data-alert="北京街铺业绩填写完整" class="beijing-bitian-9" v-model.number="office_yeji_BJ"/></td>
<td>{{zhanbi(office_yeji_BJ, shop_yeji_BJ)}}</td>
<td colspan="2"><input type="number" placeholder="填写" data-alert="北京街铺成交单数填写完整" class="beijing-bitian-11"/></td>
</tr>
<tr class="beijing">
......
......@@ -46,7 +46,10 @@
</div>
</td>
</tr>
<tr>
<td colspan="4">楼号/栋/座:{{d.mansion}}</td>
</tr>
<tr>
<td>所在楼层:{{d.floor}}</td>
<td>房号:{{d.room_number}}</td>
......
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>同联商业</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
<meta name="Keywords" content="" />
<meta name="Description" content="" />
</head>
<body style="display: none;">
<div id="app">
<main>
<section class="list-area1 oh">
<ul>
<li v-if="false">
<div>客户姓名:</div>
<div>QQQQ</div>
</li>
<li v-if="false">
<div>商铺类型:</div>
<div>商场</div>
</li>
<li>
<div>商铺号:</div>
<div class="flex-center">
<input type="number" v-model="house_number" placeholder="请输入" />
</div>
</li>
<li>
<div>业态品牌:</div>
<div class="flex-center">
<input type="text" v-model.trim="industry_type" placeholder="请输入" />
</div>
</li>
<li>
<div>成交价:</div>
<div class="flex-center">
<input type="number" v-model="price" placeholder="请输入" />
</div>
<div></div>
</li>
<li>
<div>预计收款时间:</div>
<div class="flex-center">
<input type="date" v-model="estimated_receipt_date" placeholder="请输入" />
</div>
</li>
</ul>
<ul>
<li v-if="false">
<div>客户电话:</div>
<div>QQQQ</div>
</li>
<li v-if="false">
<div>商铺地址:</div>
<div>bbbb</div>
</li>
<!--<li>
<div>是否开业:</div>
<div class="arrow-select-pc flex-center">
<select v-model="is_open">
<option value="">请选择</option>
<option value="1">是</option>
<option value="0">否</option>
</select>
</div>
</li>-->
<li>
<div>成交类型:</div>
<div class="arrow-select-pc flex-center">
<select v-model="trade_type">
<option value="">请选择</option>
<option value="10">出租</option>
<option value="20">增佣</option>
<option value="30">代理</option>
<option value="40">好处费</option>
</select>
</div>
</li>
<li>
<div>应收佣金:</div>
<div class="flex-center">
<input type="number" v-model.trim="commission" id="commission_input" placeholder="请输入" />
</div>
<div></div>
</li>
</ul>
</section>
<section class="list-area2">
<p>分佣提成</p>
<ul></ul>
<div class="fenyong-add-area flex-center">
<img src="/app/images/jia2@2x.png">
</div>
</section>
<section class="btn-area">
<div></div>
<div class="flex-center">
<a href="javascript:;" @click="save">提交</a>
</div>
</section>
</main>
</div>
<script id="fenyong_li_tpl" type="text/template">
<li class="fenyong-li por">
<ul class="flex">
<li class="fenyong-sub-li flex">
<div>分佣方:</div>
<div class="arrow-select-pc flex-center">
<select class="fenyong-fang">
<option value="">请选择</option>
<option value="1">盘方</option>
<option value="2">客方</option>
<option value="3">反签</option>
<option value="4">独家</option>
<option value="5">合作方</option>
<!--<option value="6">APP盘下载方</option>-->
<option value="7">APP客下载方</option>
</select>
</div>
<div></div>
</li>
<li class="fenyong-sub-li flex">
<div>业务员:</div>
<div class="flex-center por">
<input type="text" class="add_input_ywy" placeholder="请输入姓名或手机号" />
<ul></ul>
</div>
<div></div>
</li>
</ul>
<ul class="flex">
<li class="fenyong-sub-li flex">
<div>分佣比例:</div>
<div class="flex-center">
<input type="number" class="fenyong-rate" placeholder="请填写" />
</div>
<div>%</div>
</li>
<li class="fenyong-sub-li flex">
<div>应分佣金:</div>
<div class="flex-center">
<input type="number" class="yingfen-yongjin" placeholder="请填写" />
</div>
<div></div>
</li>
</ul>
<mark class="poa"><img src="/app/images/search_gb.png"></mark>
</li>
</script>
<script src="/app/js/libs/require.min.js" data-js="/app/js/submit_report_pc_office.js" data-main="/app/js/main" data-norem="yes" defer async="true"></script>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
......@@ -15,11 +15,14 @@ use app\chat\extend\Basic;
use app\chat\service\ChatService;
use app\chat\utils\RPush;
use app\extra\RedisPackage;
use app\index\service\OfficeRoomService;
use app\model\AAgents;
use app\model\ChatMsg;
use app\model\GHouses;
use app\model\GHousesImgs;
use app\model\MPushMessage;
use app\model\OfficeGImg;
use app\model\OfficeGRoom;
use app\model\Users;
use think\Cache;
use think\Exception;
......@@ -207,7 +210,6 @@ class AppChat extends Basic
if (true !== $checkResult) {
return $this->response(ErrorCodeConst::ERROR_CODE_PARAM_NOT_EXIST, $checkResult);
}
$user_name = isset($params['user_name']) ? $params['user_name'] : $params['from'];//用户昵称
$target_type = $params['target_type']; // 消息类型 users 给用户发消息。chatgroups: 给群发消息,chatrooms: 给聊天室发消息
$target = $params['target']; //接受人 if target_type 群 者表示群id
......@@ -221,6 +223,7 @@ class AppChat extends Basic
}
$result = $this->_chat->sendMsg($user_name, $target_type, $target, $source, $is_user, $type, $msg_content, $from);
if ($result) {
return $this->response("200", "", ["msg" => "消息发送成功"]);
} else {
......@@ -463,6 +466,34 @@ class AppChat extends Basic
}
/**
* 聊天获取办公楼信息
* @return \think\Response
*/
public function getOfficeRoomInfo()
{
$params = $this->params;
/*$params = array(
'id' => 1,
);*/
if (!isset($params['id'])) {
return $this->response("300", "参数不全");
}
$m_office_room = new OfficeGRoom();
$service_room = new OfficeRoomService();
$field = 'b.title,a.area,a.price';
$result = $m_office_room->getOfficeRoomInfo($field, ['a.id' => $params['id']]);
if ($result) {
$result['price'] = $result['price'] * 0.01;
$result['carousel_image'] = $service_room->getCarouselImageByOne($params['id'],2);
return $this->response("200", "success!", $result);
} else {
return $this->response("400", "暂无数据!");
}
}
/**系统消息商铺修改消息
* @return \think\Response
*/
......
......@@ -15,11 +15,11 @@ class ChatVerifyValidate extends Validate
{
/**
* $target_type = $params['target_type']; // 消息类型 users 给用户发消息。chatgroups: 给群发消息,chatrooms: 给聊天室发消息
* $target_type = $params['target_type']; // 消息类型 users 给用户发消息。chatgroups: 给群发消息,chatrooms: 给聊天室发消息
* $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楼盘 4经纪人
* $type = $params['type']; //消息类型 1文字 2图片 3楼盘 4客户 5 办公楼
* $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,4',
'type' => 'require|in:1,2,3,4,5',
'msg_content' => 'require',
'from' => 'require',
];
......
......@@ -103,6 +103,48 @@ function down_file($url, $dir, $filename='', $date){
return $filename;
}
/**
* 文件下载
*
* @param $url
* @param $dir
* @param string $filename
* @param $date
* @return bool|string
*/
function down_file_name($url, $dir, $file_name, $date){
if(empty($url)){
return false;
}
if (empty($date)) {
$date = date('Ymd');
} else {
$date = date('Ymd', strtotime($date));
}
$ext = strrchr($url, '.');
$dir = $dir.DS.$date;
if (!file_exists($dir)) {
mkdir($dir, 0777);
}
//目录+文件
$tmp_name = (empty($file_name) ? time().''.$ext : $file_name);
$save_file_path = $dir .DS. $tmp_name;
//开始捕捉
ob_start();
readfile($url);
$img = ob_get_contents();
ob_end_clean();
$fp2 = fopen($save_file_path , "a");
fwrite($fp2, $img);
fclose($fp2);
return $date.'/'.$file_name;
}
/**
* 隐藏客户手机号中间几位
......@@ -183,4 +225,41 @@ function big_log($content,$filename='find_bug'){
$content = $time_str.$content."\r\n";
file_put_contents($filenames, $content, FILE_APPEND);
}
/**
* @param $url
* @param array $params
* @param int $timeout
* @return bool|string
*/
function curl_get($url, array $params = array(), $timeout = 5)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$file_contents = curl_exec($ch);
curl_close($ch);
return $file_contents;
}
/**
* @param $url
* @param array $params
* @param $timeout
* @return bool|string
*/
function curl_post($url, array $params = array(), $timeout)
{
$ch = curl_init();//初始化
curl_setopt($ch, CURLOPT_URL, $url);//抓取指定网页
curl_setopt($ch, CURLOPT_HEADER, 0);//设置header
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);//要求结果为字符串且输出到屏幕上
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
curl_setopt($ch, CURLOPT_POST, 1);//post提交方式
curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
$data = curl_exec($ch);//运行curl
curl_close($ch);
return ($data);
}
\ No newline at end of file
......@@ -556,7 +556,7 @@ class Broker extends Basic
//查看
$m_agent = new AAgents();
$field = 'id,name,phone,password,district_id,store_id,sex,admin_off,remarks';
$result['data'] = $m_agent->verifyUser($field, '', ['id' => $this->params['id']]);
$result['data'] = $m_agent->getAgentInfo($field, $this->params['id']);
}
return $this->response($result['code'], $result['msg'], $result['data']);
}
......
This diff is collapsed.
......@@ -352,8 +352,9 @@ class Member extends Basic{
// big_log(json_encode($where));
$fields = 'a.id,a.user_nick,a.create_time,a.user_name,a.user_phone,a.user_pic,a.create_time,a.user_pswd,a.referrer_id,a.user_label,
a.user_name,a.status,a.agent_id,a.vip,a.price_demand,a.industry_type,a.area_demand,a.user_status,a.source,a.entrust_type';
$fields = 'a.id,a.user_nick,a.create_time,a.user_name,a.user_phone,a.user_pic,a.create_time,a.user_pswd,
a.referrer_id,a.user_label,a.user_name,a.status,a.agent_id,a.vip,a.price_demand,a.industry_type,a.area_demand
,a.user_status,a.source,a.entrust_type,a.concrete_industry';
try {
$return_user_list = $this->user->getUserAgent($pageNo, $pageSize, 'a.id DESC', $fields, $where, $type);
......
This diff is collapsed.
......@@ -105,6 +105,26 @@ class OfficeBuilding extends Basic
return view('officeBuilding/account_statement_shop');
}
}
//办公楼跟进列表
public function officeFollowUp()
{
if (!$this->request->isAjax()) {
return view('officeBuilding/officeFollowUp');
}
}
//成交报告 撤销
public function undoReportCJOffice()
{
if (!$this->request->isAjax()) {
return view('officeBuilding/office_statement_backout');
}
}
public function undoReportCJShop()
{
if (!$this->request->isAjax()) {
return view('officeBuilding/shop_statement_backout');
}
}
}
<?php
/**
* Created by PhpStorm.
* User: hu jun
* Date: 2018/3/13
* Time: 15:48
*/
namespace app\index\controller;
use app\api\service\ConvertCouponService;
use app\api\service\CouponService;
use app\api_broker\service\OrderLogService;
use app\api_broker\service\PayLogOpenService;
use app\api_broker\service\PayLogService;
use app\api_broker\service\RedisCacheService;
use app\api_broker\service\VipService;
use app\index\extend\Basic;
use app\index\untils\ExportExcelUntil;
use app\model\AAgents;
use app\model\AStore;
use app\model\GHouses;
use app\model\GHousesToAgents;
use app\model\OBargainLogModel;
use app\model\OBargainModel;
use app\model\ODaily;
use app\model\OfficeOImg;
use app\model\OfficeOPartialCommission;
use app\model\OfficeOPayLogModel;
use app\model\OImg;
use app\model\OMarchInModel;
use app\model\OPayLogAdjustment;
use app\model\OPayLogOpen;
use app\model\OPayLogOpenLog;
use app\model\OrderModel;
use app\model\ORealIncome;
use app\model\ORefundLogModel;
use app\model\OReportModel;
use app\model\OTaxes;
use app\model\OFinancialAudit;
use app\model\OPartialCommission;
use app\model\OPayLogModel;
use app\model\ORefundModel;
use app\model\TAgentTotalModel;
use app\model\Users;
use app\task\controller\ResultsSummaryNewTask;
use think\Exception;
use think\Request;
class OfficeFinance extends Basic
{
public function __construct(Request $request = null)
{
parent::__construct($request);
}
/**
* 实收明细
* 分佣提成明细表
* @return \think\Response|\think\response\View
*/
public function partialCommissionList()
{
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$where = [];
$where['a.confirm_status'] = 1;
$where['a.is_del'] = $select = 0;
$where['b.status'] = ['in','10,11,13'];
if (!empty($this->params['create_time']) && empty($this->params['end_time'])) {
$where['f.income_time'] = [ '>= time', $this->params['create_time'] . ' 00:00:00' ];
$select = 1;
}
if (!empty($this->params['end_time']) && empty($this->params['create_time'])) {
$where['f.income_time'] = [ '<= time', $this->params['end_time'] . ' 23:59:59' ];
$select = 1;
}
if (!empty($this->params['end_time']) && !empty($this->params['create_time'])) {
$where['f.income_time'] = [ 'between time', [ $this->params['create_time'] . ' 00:00:00', $this->params['end_time'] . ' 23:59:59' ] ];
$select = 1;
}
if (!empty($this->params['internal_address'])) {
$where['s.address'] = [ 'like', '%' . $this->params['internal_address'] . '%' ];
$select = 1;
}
if (!empty($this->params['partial_id'])) {
$where['e.id'] = $this->params['partial_id'];
$select = 1;
}
if (!empty($this->params['house_number'])) {
$where['b.house_number'] = [ 'like', '%' . $this->params['house_number'] . '%' ];
$select = 1;
}
if (!empty($this->params['bargain_id'])) {
$where[] = [ 'EXP', 'b.id =' . $this->params['bargain_id'] . ' or father_id=' . $this->params['bargain_id'] ];
$select = 1;
}
if (!empty($this->params['agents_id'])) {
$where['e.id'] = $this->params['agents_id'];
$select = 1;
}
if (!empty($this->params['store_id'])) {
$where['e.store_id'] = $this->params['store_id'];
$select = 1;
}
if (!empty($this->params['district_id'])) {
$where['e.district_id'] = $this->params['district_id'];
$select = 1;
}
big_log($where);
$field = 'a.id,b.id as bargain_id,f.income_time,a.practical_fee,b.scale_fee,s.address as internal_address,
b.agent_id,b.house_number,b.father_id,b.order_id,a.real_income_id,a.role,b.scale';
$m_Office_commission = new OfficeOPartialCommission();
try {
$data['data']['list'] = $m_Office_commission->getCommissionBargainList($pageNo, $pageSize, 'a.id desc', $field, $where);
//dump($data['data']['list']);exit;
$data['data']['total'] = $m_Office_commission->getCommissionBargainListTotal($where);
if ($select) {
$data['data']['total_money'] = $m_Office_commission->totalMoney($where); //实收总计
} else {
$data['data']['total_money'] = '';
}
} catch (\Exception $e) {
return $this->response(101, '内部错误,获取分佣提成明细列表失败!请联系运营。'.$e->getMessage());
}
return $this->response("200", "request success", $data);
}
}
<?php
namespace app\index\controller;
/**
* Created by PhpStorm.
* 进场相关
* User: zhuwei
* Date: 2018/6/13
* Time: 上午10:18
*/
use app\api_broker\service\OfficeOrderLogService;
use app\api_broker\service\OrderLogService;
use app\index\extend\Basic;
use app\model\OfficeOMarchInModel;
class OfficeMarchIn extends Basic
{
protected $oMarchInModel;
public function __construct($request = null)
{
parent::__construct($request);
$this->oMarchInModel = new OfficeOMarchInModel();
}
/**
* 进场记录列表
* User: 朱伟
* Date: 2018/6/13
* Time: 上午10:34
*/
public function marchInList(){
if (!$this->request->isAjax()) {
return view('office_marchin/marchin_list');
}
$params = $this->params;
$checkResult = $this->validate($params, "VerifyValidate.select");
if (true !== $checkResult) {
//return $this->response("101", $checkResult);
}
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$where = [];
//搜索条件 start
//1.进场时间
if (!empty($params['create_time_start']) && !empty($params['create_time_end'])) {
$where['a.create_time'] = ['between time', [$params['create_time_start']. ' 00:00:00', $params['create_time_end'] . ' 23:59:59']];
}
//2.部门
if (!empty($params['district_id'])) {
$where['b.district_id'] = $params['district_id'];
}
//3.门店名称
if (!empty($params['store_id'])) {
$where['b.store_id'] = $params['store_id'];
}
//4.客户姓名
if (!empty($params['user_name'])) {
$where['d.user_name'] = ['LIKE','%'.$params['user_name'].'%'];
}
//5.客户手机号
if (!empty($params['user_phone'])) {
$where['d.user_phone'] = ['LIKE','%'.$params['user_phone'].'%'];
}
//6.报备人手机号
if (!empty($params['report_agent_phone'])) {
$where['d.report_agent_phone'] = ['LIKE','%'.$params['report_agent_phone'].'%'];
}
//7.报备人姓名
if (!empty($params['report_agent_name'])) {
$where['d.report_agent_name'] = ['LIKE','%'.$params['report_agent_name'].'%'];
}
//8.商铺名
if (!empty($params['house_title'])) {
$where['c.house_title'] = ['LIKE','%'.$params['house_title'].'%'];
}
//9.商铺类型
// if (isset($params['shop_type']) && $params['shop_type'] != -1) {
// $where['f.shop_type'] = $params['shop_type'] ;
// }
//10.带看ID
if (!empty($params['order_id'])) {
$where['a.order_id'] = $params['order_id'] ;
}
//11.客户id
if (!empty($params['user_id'])) {
$where['d.user_id'] = $params['user_id'];
}
//12.商铺id
if (!empty($params['house_id'])) {
$where['c.house_id'] = $params['house_id'];
}
//搜索条件 end
$fields_evaluate = 'a.id,a.report_id,a.order_id,d.user_name,d.user_phone,a.create_time,d.report_agent_name,';
$fields_evaluate .= 'd.report_agent_phone,e.store_name,a.march_in_img,g.longitude,g.latitude,a.march_in_area';
$data['list'] = $this->oMarchInModel->findmarchInList($pageNo, $pageSize, 'a.id desc', $fields_evaluate, $where);
$data['total'] = $this->oMarchInModel->findmarchInListCount($fields_evaluate, $where);
$OrderLogService = new OfficeOrderLogService();
foreach ($data['list'] as $k => $v) {
if($v['march_in_img']){
$data['list'][$k]['march_in_img'] = [['img_name'=>$v['march_in_img']]];
}else{
$data['list'][$k]['march_in_img'] = $OrderLogService->getOImg($v['id'], 1);
}
}
foreach ($data['list'] as $k=>$v) {
$data['list'][$k]['user_phone'] = preg_replace('/(\d{3})\d{4}(\d{4})/', '$1****$2', $v["user_phone"]);
}
return $this->response(200, 'success', $data);
}
}
\ 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.
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.
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.
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