Commit 0a85c47e authored by hujun's avatar hujun

Merge branch '0321-v3.1.3' into test

# Conflicts: # application/index/controller/Finance.php # application/route.php
parents 8624997f db15c837
......@@ -12,6 +12,7 @@ namespace app\api\controller;
use app\api\extend\Basic;
use app\api_broker\service\LookShopService;
use app\api_broker\service\VerifyService;
use app\index\service\HouseService;
use app\model\AAgents;
use app\model\AttentionModel;
use app\model\GHouses;
......@@ -103,6 +104,7 @@ class Shop extends Basic
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$s_house = new HouseService();
//c端查对外的名字 b端查对内的名字
if (isset($params['title'])) {
......@@ -231,6 +233,10 @@ class Shop extends Basic
$house_img_where["img_type"] = 2; //默认主图 产品盼盼于11.16号修改
$result[$key]["images"] = $this->gHousesImgModel->getHouseImages($house_img_where, 1);
}
#商铺视频
$result[$key]['shop_videos'] = $s_house->getHouseVideoList($val['id']);
// $result[$key]['shop_videos_length'] = $s_house->getHouseVideoLength();
}
if ($params['site_area'] == 6) {
......@@ -407,6 +413,12 @@ class Shop extends Basic
$result['address'] = $result['city'].$result['disc'].$result['internal_title'];//7151
#商铺视频
$s_house = new HouseService();
$result['shop_videos'] = $s_house->getHouseVideoList($params["id"]);
$result['shop_videos_length'] = $s_house->getHouseVideoLength();
return $this->response("200", 'request success', $result);
}
......
......@@ -60,7 +60,7 @@ class Bargain extends Basic
$agent_res = $this->agentModel->getAgentsInfoByAgentId($agent_field, [ "agent_id" => $submit_agent_id ]);
if(($agent_res[0]['level'] == 10) && ($is_my_correlation == 0)){
return $this->response("200", "暂无权限!");
return $this->response("101", "暂无权限!");
}
/*业务员不允许点击查看全部成交报告 end*/
......
......@@ -80,7 +80,7 @@ class HomePageLog extends Basic
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$field = "id,user_id,agent_id,type,content,create_time,user_status";
$field = "id,user_id,agent_id,type,content,create_time,user_status,labels_id";
$where_ = [];
$where = ' 1=1 ';
if (!empty($params["search_content"])) {
......
......@@ -320,6 +320,22 @@ class OrderLog extends Basic
return $this->response("200", "request null");
}
}
public function getCommission(){
$params = $this->params;
/* $params = array(
"bargain_id" => 1
);*/
if (!isset($params["bargain_id"])) {
return $this->response("101", "成交交报告id不能为空");
}
$CommissionInfo = $this->service_->getCommission($params["bargain_id"]);
if (count($CommissionInfo) > 0) {
return $this->response("200", "request success", $CommissionInfo);
} else {
return $this->response("200", "request null");
}
}
/**
* 保存pos机收款记录
......@@ -657,16 +673,19 @@ class OrderLog extends Basic
/* $params = array(
"submit_agent_id" => 1,
"keyword" => "17717536291",
"type" => 1,//1商铺id 2商铺地址 3成交报告id 4带看id 5客户id
"page_no" => 1,
"page_size" => 15
);*/
if (!isset($params["submit_agent_id"]) || !isset($params["keyword"])) {
if (!isset($params["submit_agent_id"]) || !isset($params["keyword"]) || !isset($params["type"]) ) {
return $this->response("101", "请求参数错误");
}
if(($params["type"] == 1 || $params["type"] == 3 || $params["type"] == 4 || $params["type"] == 7) && !preg_match("/^\d*$/",$params["search_keyword"])){
return $this->response("101", "输入的搜索内容错误");
}
try {
$result = $this->service_->getBargainList($params);
$result["result"] = $this->service_->getBargainList($params);
if (count($result) > 0) {
return $this->response("200", "request success", $result);
} else {
......
......@@ -17,6 +17,7 @@ use app\model\GHousesExt;
use app\model\GHousesFollowUp;
use app\model\GHousesImgs;
use app\model\GHousesToAgents;
use app\model\GHousesVideo;
use app\model\GImageDepot;
use app\model\GLandlordPhone;
use app\model\OBargainModel;
......@@ -694,7 +695,17 @@ class Shop extends Basic
//判断是否有权限点击独家合同按钮 0:可查看 1:不可查看
$s_house = new HouseService();
$result['is_can_edit_only_contract'] = $s_house->isCanEditOnlyContract($this->agentId,$params["id"]);
#商铺视频
// dump('999');exit;
$result['shop_videos'] = $s_house->getHouseVideoList($params['id']);
$result['shop_videos_length'] = $s_house->getHouseVideoLength();
$upload_video_num = $s_house->getHouseVideoNum($params['id']);
$result['is_upload_video'] = 0;
if ($upload_video_num < 3) {
$result['is_upload_video'] = 1;
}
unset($result['external_image_id']);
return $this->response("200", 'request success', $result);
}
......@@ -1090,4 +1101,121 @@ class Shop extends Basic
return $this->response($code, $msg);
}
/**
* 添加商铺视频
*
* @return \think\Response
*/
public function addHouseVideo()
{
if (empty($this->params['house_id']) || empty($this->params['video_name'])) {
return $this->response(101, '参数错误');
}
$code = 200;
$msg = '';
$service = new HouseService();
$result = $service->addVideo($this->params['house_id'], $this->params['video_name'], $this->params['video_image'], $this->agentId, $this->agentName, $this->agentPhone);
if ($result['status'] == 'fail') {
$code = 101;
$msg = $result['msg'];
}
return $this->response($code, $msg, []);
}
/**
* 商铺视频列表
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function houseVideoList()
{
if (isset($this->params['is_check']) && $this->params['is_check'] != 0) {
if ($this->params['is_check'] == 1) {
$where['check_id'] = 0;
} else {
$where['check_id'] = ['>', 0];
}
}
$where['is_del'] = 0;
$vip = new VipService();
$is_auth = $vip->checkRule($this->agentId, 'index/checkVideo');
if ($is_auth) {
$where['a.upload_id'] = $this->agentId;
$is_auth = 0;
} else {
$m_agent = new AAgents();
$agent_data = $m_agent->getAgentInfo('district_id,store_id', $this->agentId);
$where['b.district_id'] = $agent_data['district_id'];
$where['b.store_id'] = $agent_data['store_id'];
$is_auth = 1;
}
$m_house_video = new GHousesVideo();
$pageNo = empty($this->params['page_no']) ? 1 : $this->params['page_no'];
$pageSize = empty($this->params['page_size']) ? 15 : $this->params['page_size'];
$field = 'a.id,a.video_name,a.house_id,a.upload_name,a.check_name,a.check_id,a.check_time,a.create_time,a.video_image';
$data = $m_house_video->getVideoAgentList($pageNo, $pageSize, 'a.id desc', $field, $where);
foreach ($data as $k=>$v) {
$data[$k]['check_time'] = $v['check_time'] ? $v['check_time'] : '';
$data[$k]['check_status'] = $v['check_id'] ? 1 : 0;
$data[$k]['path'] = 'resource/lib/Attachments/video/';
$data[$k]['is_auth'] = $is_auth;
$data[$k]['check_time'] = date('Y-m-d', strtotime($v['check_time']));
$data[$k]['create_time'] = date('Y-m-d', strtotime($v['create_time']));
}
return $this->response(200, '', $data);
}
/**
* 删除和审核视频
*
* @return \think\Response
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function checkVideo()
{
$code = 101;
if (empty($this->params['video_id']) || empty($this->params['type'])) {
return $this->response($code, '参数错误');
}
$m_house_video = new GHousesVideo();
$num = $m_house_video->getTotal(['id'=>$this->params['video_id'], 'is_del'=>0]);
if (!$num) {
return $this->response($code, '没有该视频');
}
if ($this->params['type'] == 'check') {
$data['check_id'] = $this->agentId;
$data['check_name'] = $this->agentName;
$data['check_time'] = date('Y-m-d H:i:s');
$rule_name = 'index/checkVideo';
} else {
$data['is_del'] = 1;
$rule_name = 'index/delVideo';
}
$vip = new VipService();
$is_auth = $vip->checkRule($this->agentId, $rule_name);
if ($is_auth) {
return $this->response(101, '没有权限');
}
$num = $m_house_video->updateData($data, ['id'=>$this->params['video_id']]);
if ($num) {
$msg = '审核成功';
$code = 200;
} else {
$msg = '审核失败';
}
return $this->response($code, $msg);
}
}
......@@ -8,11 +8,13 @@ use app\model\AAgents;
use app\model\AStore;
use app\model\GHouses;
use app\model\GHousesToAgents;
use app\model\OBargainModel;
use app\model\ODaily;
use app\model\ODailyLog;
use app\model\OImg;
use app\model\OPayLogAdjustment;
use app\model\OPayLogModel;
use app\model\OReportModel;
/**
* Created by PhpStorm.
......@@ -262,7 +264,8 @@ class DailyPaperService
$payLogModel = new OPayLogModel();
//中介费入账
$field = "a.id,c.id as bargain_id,b.house_id,c.price,a.money,a.pay_type,a.transfer_name,a.type,a.type_ext,a.income_time,
d.report_agent_id as agent_id,c.is_open,a.is_dividend,a.receipt_number,a.create_time,a.remark,a.received_money,a.transaction_fee";
d.report_agent_id as agent_id,c.is_open,a.is_dividend,a.receipt_number,a.create_time,a.remark,a.received_money,a.transaction_fee,
a.order_no,a.order_id,a.report_id,a.bargain_id";
$params["a.agent_id"] = array("in", ($ids));
$params["a.create_time"] = array("between", array($daily_data, $daily_data . " 23:59:59"));
$params["a.is_del"] = 0;
......@@ -271,6 +274,18 @@ class DailyPaperService
$info["agency_fee"] = $this->getHouseAndAgentInfo(
$payLogModel->selectPayLogListByBargain($field, $params)
);
foreach ($info["agency_fee"] as $k=>$v) {
$info["agency_fee"][$k]['current_agent_name'] = '';
if ($v['bargain_id'] > 0) {
$current_agent_name = $this->getBargainAgent($v['bargain_id']);
if ($current_agent_name) {
$info["agency_fee"][$k]['current_agent_name'] = $current_agent_name;
}
}
}
//案场费入账 盘方
$params["a.type"] = 92;
......@@ -278,23 +293,52 @@ class DailyPaperService
$new_case_fee_arr = $this->getHousePan($case_fee_arr);
$info["case_fee"] = $this->getHouseAndAgentInfo($new_case_fee_arr);
foreach ($info["case_fee"] as $k=>$v) {
$info["case_fee"][$k]['current_agent_name'] = '';
if ($v['bargain_id'] > 0) {
$current_agent_name = $this->getBargainAgent($v['bargain_id']);
if ($current_agent_name) {
$info["case_fee"][$k]['current_agent_name'] = $current_agent_name;
}
}
}
$field_money = "a.id,a.money,a.type,a.type_ext,b.house_id,b.id as order_id,a.pay_type,a.transfer_name, d.report_agent_id as agent_id,
a.is_dividend,a.receipt_number,a.create_time,a.income_time,a.transaction_fee";
a.is_dividend,a.receipt_number,a.create_time,a.income_time,a.transaction_fee,a.order_no,a.order_id,a.report_id";
//意向金
$params["a.type"] = 10;
unset($params["c.father_id"]);
$info["earnest_money"] = $this->getHouseAndAgentInfo(
$payLogModel->selectPayLogListByBargainReport($field_money, $params)
);
$m_report = new OReportModel();
foreach ($info["earnest_money"] as $k=>$v) {
if ($v['report_id'] > 0) {
$current_agent_name = $m_report->selectReportById('report_agent_name,report_store_id', ['id'=>$v['report_id']]);
$info["earnest_money"][$k]['current_agent_name'] = empty($current_agent_name[0]['report_agent_name']) ? "" : $current_agent_name[0]['report_agent_name'];
} else {
$info['earnest_money'][$k]['current_agent_name'] = '';
}
}
//保管金
$params["a.type"] = 30;
$info["custody_money"] = $this->getHouseAndAgentInfo(
$payLogModel->selectPayLogListByBargainReport($field_money, $params)
);
foreach ($info["custody_money"] as $k=>$v) {
if ($v['report_id'] > 0) {
$current_agent_name = $m_report->selectReportById('report_agent_name,report_store_id', ['id'=>$v['report_id']]);
$info['custody_money'][$k]['current_agent_name'] = empty($current_agent_name[0]['report_agent_name']) ? "" : $current_agent_name[0]['report_agent_name'];
} else {
$info['custody_money'][$k]['current_agent_name'] = '';
}
}
//调整出账
$field_adjustment = "b.id,c.house_id,b.new_paylog_id as pay_log_id,a.agent_id,b.money,a.income_time,b.type,a.receipt_number,a.create_time,a.transaction_fee,b.paylog_id as old_paylog_id";
$field_adjustment = "b.id,c.house_id,b.new_paylog_id as pay_log_id,a.agent_id,b.money,a.income_time,b.type,a.receipt_number,a.create_time,a.transaction_fee,b.paylog_id as old_paylog_id,a.report_id";
$params_adjustment["b.operation_id"] = array("in", ($ids));
$params_adjustment["a.is_del"] = 0;
$params_adjustment["b.is_del"] = 0;
......@@ -734,4 +778,31 @@ class DailyPaperService
}
return $result;
}
/**
* 对应业务员
*
* @param $bargain_id
* @return string
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getBargainAgent($bargain_id)
{
$bargain_where[] = ['EXP','a.id ='.$bargain_id.' or father_id='. $bargain_id];
$bargain_where['a.status'] = ['in','10,11,13'];
$bargain_where['a.role'] = ['in','3,4,5'];
$m_bargain = new OBargainModel();
$bargain_data = $m_bargain->agentBargainAll('a.role,a.scale,b.name', $bargain_where);
$role_arr = [1=>'盘方', 2=>'客方',3=>'反签',4=>'独家',5=>'合作方',6=>'APP盘下载方',7=>'APP客下载方'];
$name = '';
foreach ($bargain_data as $k2=>$v2) {
$name .= $v2['name'] . '('.$role_arr[$v2['role']].$v2['scale'].'%),';
}
return rtrim($name, ',');
}
}
\ No newline at end of file
......@@ -639,7 +639,7 @@ class OrderLogService
$field_refund = "a.id,a.report_id,a.agent_id,a.agent_name,a.order_no,a.order_id,a.refund_money,a.status,a.name
,a.phone,a.bank,a.card_no, a.remark,a.receipt_number,a.type,a.refund_cause,a.pay_log_id,a.refund_way,
a.create_time,b.income_time";
$refundData = $oRefundModel->selectRefundDetailByOrderNo($field_refund, ["order_id" => $order_id]);
$refundData = $oRefundModel->selectRefundDetailByOrderNo($field_refund, ["order_id" => $order_id, 'del'=>0]);
if (count($refundData) > 0) {
foreach ($refundData as $k => $v) {
$v["step_name"] = "refund";
......@@ -652,7 +652,7 @@ class OrderLogService
//成交报告
$field_bargain = "a.id,a.father_id,a.house_number,a.is_open,a.report_id,a.order_id,a.trade_type,a.submit_agent_id,a.industry_type,
a.estimated_receipt_date,a.submit_agent_name, a.price,a.commission,a.role,a.agent_id,a.scale,a.scale_fee,a.create_time,b.name,b.phone,a.is_commission";
$bargainData = $oBargainModel->selectBargainListByOrderNo($field_bargain, ["order_id" => $order_id]);
$bargainData = $oBargainModel->selectBargainListByOrderNo($field_bargain, ["order_id" => $order_id, 'status'=> ['<>', 30]]);
if (count($bargainData) > 0) {
$bargain_data_arr = $this->arr2TreeBargain($bargainData);
foreach ($bargain_data_arr as $k2 => $v2) {
......@@ -1369,10 +1369,9 @@ class OrderLogService
$ids = $aService->getAgentsByAgentId($agent_id);
$params["ids"] = $ids;
$bargainModel = new OBargainModel();
$filed = "a.id,a.father_id,a.house_number,a.commission,a.agent_id,a.create_time,b.user_phone,b.user_name,b.user_id,c.id as order_id,
d.id as house_id,d.internal_title,d.internal_address";
$filed = "a.id,a.father_id,a.house_number,a.price,a.commission,a.agent_id,a.create_time,b.user_phone,
b.user_name,b.user_id,c.id as order_id,c.order_no,d.id as house_id,d.internal_title,d.internal_address,b.id as report_id";
$result = $bargainModel->selectBargainList($filed, $params, $pageNo, $pageSize);
$list = [];
foreach ($result as $k => $v) {
......@@ -1763,4 +1762,12 @@ class OrderLogService
return $this->payLogModel->updatePayLog($params);
}
public function getCommission( $bargain_id){
$filed = "a.role,a.agent_id,b.name,a.scale";
$params["a.id|a.father_id"] = $bargain_id;
$params["a.role"] = array("in","3,4,5");
return $this->bargainModel->agentBargainAll($filed, $params);
}
}
\ No newline at end of file
......@@ -20,7 +20,7 @@ class UploadFileService
* @param array $ext
* @return array
*/
public function upload($_upload_file, $type, $size = 10000000, $ext = [ 'jpg','png','jpeg','xlsx','doc','docx','pdf','ppt','pptx','xls','gif'])
public function upload($_upload_file, $type, $size = 10000000, $ext = [ 'jpg','png','jpeg','xlsx','doc','docx','pdf','ppt','pptx','xls','gif','mp4','video/mp4'])
{
/**
*
......@@ -100,11 +100,17 @@ class UploadFileService
$path .= 'static/check/';
$internet_path = 'static/check/';
break;
case 'house_video':
$path .= 'resource/lib/Attachments/video/';
$internet_path = '';
break;
default :
$data['code'] = 101;
$data['msg'] = "上传图片类型错误";
return $data;
}
$date = date('Ymd');
$path .= $date;
$name_str = date('YmdHis');
......
This diff is collapsed.
......@@ -22,6 +22,7 @@ use app\model\GHousesExt;
use app\model\GHousesFollowUp;
use app\model\GHousesImgs;
use app\model\GHousesToAgents;
use app\model\GHousesVideo;
use app\model\GLandlordPhone;
use app\model\GOperatingRecords;
use app\model\SubletModel;
......
......@@ -6,6 +6,7 @@ use app\api\service\ConvertCouponService;
use app\api\untils\MessageUntils;
use app\api_broker\service\VipService;
use app\index\extend\Basic;
use app\index\service\HouseService;
use app\index\service\ImageDepotService;
use app\index\service\UserService;
use app\model\AAgents;
......@@ -181,10 +182,19 @@ class ImageDepot extends Basic
public function ceshi()
{
$service = new ConvertCouponService();
$service->convertCoupon(135281, 12,12,12); //核销红包
// $user_service = new UserService();
// $agent_id = 6446;
// $user_id = 89;
//
// $is_report = $user_service->isReport($agent_id,$user_id);
// dump($is_report);
// big_log('cehsi');
$user_service = new UserService();
$data['is_can_look'] = $user_service->isUserAgentDirector(55, 51);
dump($data);
dump(0);exit;
}
......
......@@ -81,6 +81,25 @@ class Report extends Basic
$where['b.id'] = $this->params['order_id'];
}
//城市
if (!empty($this->params['city'])) {
$where['c.city'] = $this->params['city'];
}
//商铺地址
if (!empty($this->params['internal_address'])) {
$where['c.internal_address'] = ['like', '%' . $this->params['internal_address'] . '%'];
}
//商铺ID
if (!empty($this->params['shop_id'])) {
$where['c.id'] = $this->params['shop_id'] ;
}
//客户ID
if (!empty($this->params['user_id'])) {
$where['a.user_id'] = $this->params['user_id'] ;
}
$field = 'b.id as order_id,a.user_name,a.user_phone,a.create_time,a.report_agent_name,c.internal_title as house_title,a.predict_see_time';
$field .= ',a.id,b.order_no';
......
......@@ -25,86 +25,6 @@ class Setting extends Basic
$this->m_config = new SystemConfig();
}
/**
* 显示视图,新增和编辑设置数据
*
* @return \think\Response|\think\response\View
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getSetting() {
if ($this->request->isAjax()) {
$data = [];
if ($this->request->isGet()) {
//获取数据
$data = $this->m_config->getSetting();
} else {
//新增或编辑数据
$data['is_privacy'] = (int)$this->params['is_privacy'];
$data['day_num'] = (int)$this->params['day_num'];
$data['down_time'] = $this->params['down_time'];
$data['landlord_phone_day'] = (int)$this->params['landlord_phone_day'];
$data['agent_call_day'] = (int)$this->params['agent_call_day'];
$data['agent_call_number'] = (int)$this->params['agent_call_number'];
$config_data = [];
$config_data[0]['id'] = 1;
$config_data[0]['config_name'] = '商铺自动下架天数';
$config_data[0]['config_type'] = 10;
$config_data[0]['rule'] = json_encode(['down_time'=>$data['down_time']]);
$config_data[0]['agent_id'] = $this->userId;
$config_data[1]['id'] = 2;
$config_data[1]['config_name'] = '隐私号码';
$config_data[1]['config_type'] = 20;
$config_data[1]['rule'] = json_encode([
'is_privacy'=>$data['is_privacy'],
'day_num'=>$data['day_num'],
'landlord_phone_day'=>$data['landlord_phone_day'],
'agent_call_day'=>$data['agent_call_day'],
'agent_call_number'=>$data['agent_call_number']
]);
$config_data[1]['agent_id'] = $this->userId;
$config_data[2]['id'] = 3;
$config_data[2]['config_name'] = '新客户保护期有效小时数';
$config_data[2]['config_type'] = 30;
$new_client_hours = $this->params['new_client_hours'];
$config_data[2]['rule'] = json_encode(['new_client_hours'=>$new_client_hours]);
$config_data[2]['agent_id'] = $this->userId;
$config_data[3]['id'] = 4;
$config_data[3]['config_name'] = '业务员最多可查看的商铺数量';
$config_data[3]['config_type'] = 40;
$agent_shop_num = empty($this->params['agent_shop_num']) ? 5 : $this->params['agent_shop_num'];
$config_data[3]['rule'] = json_encode(['agent_shop_num'=>$agent_shop_num]);
$config_data[3]['agent_id'] = $this->userId;
$this->m_config->insertSetting($config_data, true);
$look = new LookShopService();
$look->setLookNum($agent_shop_num);
$redis = RedisExt::getRedis();
$redis->set('s_down_time', $data['down_time']); //商铺自动下架天数
$redis->set('s_is_privacy', $data['is_privacy']); //是否使用隐号系统
$redis->set('s_day_num', $data['day_num']); //客户隐号绑定有效期(天数):
$redis->set('s_landlord_phone_day', $data['landlord_phone_day']); //房东隐号绑定有效期(天数):
$redis->set('s_new_client_hours', $new_client_hours); //新客户保护期有效小时数
$redis->set('s_lookNum', $agent_shop_num); //业务员最多可查看的商铺数量
$redis->set('s_agent_call_day', $data['agent_call_day']); //业务员多少天可以打多少电话
$redis->set('s_agent_call_number', $data['agent_call_number']); //业务员多少天可以打多少电话
}
return $this->response(200, '', $data);
} else {
//视图显示
return view('setting/index');
}
}
/**
* 系统设置
*
......@@ -169,6 +89,8 @@ class Setting extends Basic
$redis->set('s_agent_call_day', $data['agent_call_day']); //业务员多少天可以打多少电话
$redis->set('s_agent_call_number', $data['agent_call_number']); //业务员多少天可以打多少电话
$redis->set('s_agent_suspend', $data['agent_suspend']); //业务员多少天可以打多少电话
$redis->set('s_video_start_time', $data['video_start_time']); //视频开始秒数
$redis->set('s_video_end_time', $data['video_end_time']); //视频结束秒数
return ;
}
......
<?php
namespace app\index\controller;
use app\index\extend\Basic;
use app\model\GHousesVideo;
use think\Request;
/**
* Created by PhpStorm.
* User: zw
* Date: 2019/3/22
* Time: 13:56
*/
class VideoCheck extends Basic
{
private $m_houses_video;
public function __construct(Request $request = null)
{
parent::__construct($request);
$this->m_houses_video = new GHousesVideo();
}
public function videoCheckList()
{
if (!$this->request->isAjax()) {
return view('video_check/video_check_list');
}
$where['is_del'] = 0;
if (isset($this->params['district_id'])) {
$where['b.district_id'] = $this->params['district_id'];
}
if (isset($this->params['store_id'])) {
$where['b.store_id'] = $this->params['store_id'];
}
if (isset($this->params['house_id'])) {
$where['a.house_id'] = $this->params['house_id'];
}
if (isset($this->params['agent_id'])) {
$where['a.upload_id'] = $this->params['agent_id'];
}
if (isset($this->params['is_check']) && $this->params['is_check'] != 0) {
if ($this->params['is_check'] == 1) {
$where['a.check_id'] = 0;
} else {
$where['a.check_id'] = ['>', 0];
}
}
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$field = 'a.id,a.video_name,a.house_id,a.upload_name,a.check_name,a.check_id,a.check_time,a.create_time,a.video_image';
$data = $this->m_houses_video->getVideoAgentList($pageNo, $pageSize, 'a.id desc', $field, $where);
$total = $this->m_houses_video->getVideoAgentListTotal($where);
foreach ($data as $k=>$v) {
$data[$k]['check_time'] = $v['check_time'] ? $v['check_time'] : '';
}
$path = 'resource/lib/Attachments/video/';
return $this->response(200, '', ['list'=>$data, 'total'=>$total, 'path'=>$path]);
}
/**
* 删除和审核视频
*
* @return \think\Response
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function checkVideo()
{
$code = 101;
if (empty($this->params['video_id']) || empty($this->params['type'])) {
return $this->response($code, '参数错误');
}
$num = $this->m_houses_video->getTotal(['id'=>$this->params['video_id'], 'is_del'=>0]);
if (!$num) {
return $this->response($code, '没有该视频');
}
if ($this->params['type'] == 'check') {
$data['check_id'] = $this->userId;
$data['check_name'] = $this->userName;
$data['check_time'] = date('Y-m-d H:i:s');
$msg = '审核成功';
} else {
$data['is_del'] = 1;
$msg = '删除成功';
}
$num = $this->m_houses_video->updateData($data, ['id'=>$this->params['video_id']]);
if ($num) {
$code = 200;
} else {
$msg = '操作失败';
}
return $this->response($code, $msg);
}
}
......@@ -11,6 +11,7 @@ namespace app\index\service;
use app\api_broker\service\PushMessageService;
use app\api_broker\service\VipService;
use app\extra\RedisExt;
use app\index\validate\HouseValidate;
use app\model\AAgents;
use app\model\ACase;
......@@ -20,6 +21,7 @@ use app\model\GHouses;
use app\model\GHousesExt;
use app\model\GHousesImgs;
use app\model\GHousesToAgents;
use app\model\GHousesVideo;
use app\model\GLandlordPhone;
use app\model\GOperatingRecords;
use app\task\controller\ResultsSummaryNewTask;
......@@ -970,4 +972,128 @@ class HouseService
}
return $is_ok;
}
/**
* @param $house_id
* @param $video_name
* @param $video_imgage
* @param $upload_id
* @param $upload_name
* @param $upload_phone
* @return mixed
*/
public function addVideo($house_id, $video_name, $video_imgage, $upload_id, $upload_name, $upload_phone)
{
$result['status'] = 'fail';
$house_where['status'] = ['<>', 3];
$house_where['id'] = $house_id;
$id = $this->m_house->getHouseValue('id', ['status' => ['<>', 3],]);
if (empty($id)) {
$result['msg'] = '没有该商铺';
return $result;
}
$m_video = new GHousesVideo();
$video_where['house_id'] = $house_id;
$video_where['upload_id'] = $upload_id;
$video_where['is_del'] = 0;
$num = $m_video->getTotal($video_where);
if ($num > 0) {
$result['msg'] = '你已上传过该视频';
return $result;
}
$data['video_name'] = $video_name;
$data['video_image'] = $video_imgage;
$data['upload_id'] = $upload_id;
$data['upload_name'] = $upload_name;
$data['upload_phone'] = $upload_phone;
$data['house_id'] = $house_id;
$num = $m_video->insertData($data);
if ($num > 0) {
$result['status'] = 'successful';
} else {
$result['msg'] = '提交失败';
}
return $result;
}
/**
* 获取商铺图片
* @param $house_id
* @return false|\PDOStatement|string|\think\Collection
*/
public function getHouseVideoList($house_id)
{
$m_video = new GHousesVideo();
$field = 'id,video_name,video_image,upload_id,upload_name,upload_phone,check_name,create_time,check_time';
$params['house_id'] = $house_id;
$params['is_del'] = 0;
$params['check_id'] = ['>', 0];
$result = $m_video->getHouseVideo($field, $params);
if (CURRENT_URL == 'https://api.tonglianjituan.com/') {
$internet_path = CHAT_IMG_URL;
} elseif (CURRENT_URL == 'https://pre2.tonglianjituan.com/') {
$internet_path = 'http://pre2.tonglianjituan.com/resource/lib/Attachments/video/';
} else {
$internet_path = 'http://pre2.tonglianjituan.com/resource/lib/Attachments/video/';
}
foreach ($result as $k=>$v) {
$result_[$k]['id'] = $v['id'];
$result_[$k]['upload_id'] = $v['upload_id'];
$result_[$k]['check_name'] = $v['check_name'];
$result_[$k]['upload_name'] = $v['upload_name'];
$result_[$k]['upload_phone'] = $v['upload_phone'];
$result_[$k]['video_image'] = $v['video_image'] ? $internet_path.$v['video_image'] : 'http://n.sinaimg.cn/ent/transform/20170921/FVGl-fymesmp0851702.jpg';
$result_[$k]['video_path'] = $internet_path.$v['video_name'];
$result_[$k]['create_time'] = $v['create_time'];
$result_[$k]['check_time'] = $v['check_time'];
}
return $result_;
}
/**
* 视频长度
* @return mixed
*/
public function getHouseVideoLength()
{
$redis_ = RedisExt::getRedis();
$start_time = $redis_->get("s_video_start_time");
$end_time = $redis_->get("s_video_end_time");
$result_['s_video_start_time'] = $start_time? $start_time :5;
$result_['s_video_end_time'] = $end_time? $end_time :15;
return $result_;
}
/**
* 商铺视频数量
*
* @param $house_id
* @param int $is_check
* @return int|string
*/
public function getHouseVideoNum($house_id, $is_check = 0) {
$m_video = new GHousesVideo();
$where['is_del'] = 0;
$where['house_id'] = $house_id;
switch ($is_check) {
case 1 :
$where['check_id'] = 0;break; //未审核
case 2 :
$where['check_id'] = ['>', 0];break; //已审核
}
$num = $m_video->getTotal($where);
return $num;
}
}
\ No newline at end of file
......@@ -303,6 +303,9 @@ class UserLogService
#是否有权限查看vip客户 0:可查看 1:不可查看
$examine_vip = $vip_services->vip($agent_id);
#经纪人客户是否有约带看 0:可查看 1:不可查看
$is_report = $user_service->isReport($agent_id,$user_id);
if(
(($is_outpace_call_num == 0 ) and ($is_outstrip_twenty_four_hours == 1) and ($is_vip != 1) ) //过保护期
OR
......@@ -315,6 +318,8 @@ class UserLogService
(($is_outpace_call_num == 0 ) and ($is_outstrip_twenty_four_hours == 0) and (($is_user_agent_boss == 0) or ($result_agent_id == $agent_id) or ($called == 0)))
OR
(($is_outpace_call_num == 1 ) and (($is_user_agent_boss == 0) or ($result_agent_id == $agent_id) or ($called == 0)))
OR
($is_report == 0)
){
return 0;//0:显示
}else{
......
......@@ -16,6 +16,7 @@ use app\index\validate\MemberValidate;
use app\model\AAgents;
use app\model\ACollectUser;
use app\model\GOperatingRecords;
use app\model\OReportModel;
use app\model\Users;
use app\task\controller\ResultsSummaryNewTask;
use think\Log;
......@@ -371,6 +372,33 @@ class UserService
}
}
/**
* 经纪人客户是否有约带看 0:可查看 1:不可查看
* @param $agent_id
* @param $user_id
* @return int
*/
public function isReport($agent_id,$user_id){
if(!$agent_id or !$user_id){
return 1;
}
$time = time();
$m_report = new OReportModel();
$begin_date = date("Y-m-d H:i:s",strtotime("-1 week"));
$end_date = date("Y-m-d H:i:s", $time);
$conditions['report_agent_id'] = $agent_id;
$conditions['user_id'] = $user_id;
$conditions['create_time'] = array( 'between', array( $begin_date, $end_date));
$report = $m_report->selectReportByIdTime('id',$conditions);
if (count($report) > 0) {
return 0;//有约带看
}else{
return 1;//无约带看
}
}
/**
* 编辑客户详情权限 0:有权限 1:无权限
......@@ -467,6 +495,7 @@ class UserService
$params_["id"] = $user_agent_id;
$result = $agent_model->searchAgentsByKeyword("id,store_id,district_id,level", $params_);
if(!$result){
return 1;
}
......@@ -474,9 +503,12 @@ class UserService
$params__['district_id']=$result[0]['district_id'];
$params__['level']=30;
$result = $agent_model->searchAgentsByKeyword("id,store_id,district_id,level", $params__);
if ($result[0]['district_id'] == $agent_id) {
return 0;//可查看
if(isset($result[0]['district_id'])){
if ($result[0]['district_id'] == $agent_id) {
return 0;//可查看
}else{
return 1;//不可查看
}
}else{
return 1;//不可查看
}
......
{layout name="global/frame_two_tpl" /}
<input type="hidden" class="page-load" id="reportList" />
<style type="text/css">
/*收佣金*/
.modal-body-intention{
width: 900px!important;
}
.modal-body-intention tr{
height: 46px;
}
.modal-body-intention input,.modal-body-intention select{
height: 28px;
border: 1px solid #e0e0e0;
outline-style: none;
width: 200px;
}
.span-width-90{
width: 90px;
display: inline-block;
}
.tip-liu{
font-size: 15px;
}
/*收佣金*/
.envelope-list{
position: relative;
left: -144px;
......@@ -121,7 +142,7 @@
.active {
color:dodgerblue;
}
#file_input_pic {
#file_input_pic,#file_input_pic_liu{
opacity: 0;
position: absolute;
top: 0;
......@@ -133,12 +154,24 @@
.hide {
display: none !important;
}
.result-du {
.result-du,{
width:130px;
height:auto;
float:left;
text-align:center;
color:red;
}
.result-du-liu{
width:130px;
height:auto;
float:left;
text-align:center;
color:red;
margin-right: 10px;
}
.result-du-liu img{
width:130px;
height: 130px;
}
.result-du>img,.result2-du>img{
width: 120px;
......@@ -925,8 +958,8 @@
<th class="text-center">成交报告ID</th>
<th class="text-center">入账日期</th>
<th class="text-center">提交人</th>
<th class="text-center">对应业务员</th>
<th class="text-center">所属门店</th>
<!--<th class="text-center">对应业务员</th>
<th class="text-center">所属门店</th>-->
<th class="text-center">类型</th>
<th class="text-center">收款金额</th>
<th class="text-center">实付金额</th>
......@@ -1286,4 +1319,204 @@
</div><!-- /.modal-content -->
</div><!-- /.modal -->
</div>
<!--收佣金 成交报告列表-->
<div class="modal fade modal-iframe-750" id="modal-commission" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-body-intention">
<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 width="100%">
<tr>
<td>
<span class="span-width-90">对应成交报告ID:</span>
<span class="commission-bargain-id">4512</span>
</td>
<td>
<span class="span-width-90">入账金额:</span>
<input type="number" placeholder="请输入" class="commission-money">
</td>
</tr>
<tr>
<td colspan="2">
<span class="span-width-90">对应业务员:</span>
<span class="duiyingrole">101周小雨(反签40%),203洛可可(独家50%),203王小兔(合作方20%)</span>
</td>
</tr>
<tr>
<td>
<span class="span-width-90">支付方式:</span>
<select class="commission-pay-type">
<option value="">入账方式</option>
<option value="10">施总支付宝</option>
<option value="11">林老师支付宝</option>
<option value="12">筠姐支付宝</option>
<option value="20">施总微信</option>
<option value="21">林老师微信</option>
<option value="22">筠姐微信</option>
<option value="30">POS机器</option>
<option value="40">地产转账</option>
<option value="41">世家公账</option>
<option value="42">3000账号</option>
<option value="50">现金</option>
<option value="70">银满谷银行卡</option>
<option value="71">筠姐上海银行卡</option>
<option value="72">林老师建行卡</option>
<option value="73">新同联福居银行卡</option>
<option value="60">其他</option>
</select>
</td>
<td>
<span class="span-width-90">转账户名:</span>
<input type="text" placeholder="请输入" class="commission-transfer-name">
</td>
</tr>
<tr>
<td>
<span class="span-width-90">入账类型:</span>
<select class="commission-type">
<option value="91">中介费</option>
<option value="92">案场费</option>
</select>
</td>
<td>
<span class="span-width-90">入账日期:</span>
<input class="input-width-m input-width commission-income-time" type="text" value=""
onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:ss',readOnly:true})"/>
</td>
</tr>
<!--中介费-->
<tr class="zhongjiefei">
<td>
<span class="span-width-90">是否开业:</span>
<span class="shop-is-open"></span>
</td>
<td>
<span class="span-width-90">是否分红:</span>
<select class="commission-type-zhongjie">
<option value="">请选择</option>
<option value="1"></option>
<option value="2"></option>
</select>
</td>
</tr>
<tr class="zhongjiefei">
<td>
<span class="span-width-90">之前已收佣:</span>
<input type="number" placeholder="请输入" class="commission-before-zhongjie">
</td>
<td>
<span class="span-width-90">成交价:</span>
<span class="commission-price-zhongjie">66666元</span>
</td>
</tr>
<tr class="zhongjiefei">
<td>
<span class="span-width-90">中介费类型:</span>
<select class="fee-type-zhongjie">
<option value="0">正常</option>
<option value="1">多收</option>
</select>
</td>
<td>
<span class="span-width-90">应收金额:</span>
<span class="fee-money-zhongjie">66666元</span>
</td>
</tr>
<tr class="zhongjiefei">
<td>
<span class="span-width-90">多收金额:</span>
<span class="fee-more-zhongjie">66666元</span>
</td>
<td>
</td>
</tr>
<!--中介费-->
<!--案场费-->
<tr class="anchangfei">
<td>
<span class="span-width-90">是否开业:</span>
<span class="shop-is-open"></span>
</td>
<td>
<span class="span-width-90">是否分红:</span>
<select class="commission-type-anchang">
<option value="">请选择</option>
<option value="0"></option>
<option value="1"></option>
</select>
</td>
</tr>
<tr class="anchangfei">
<td>
<span class="span-width-90">之前已收佣:</span>
<input type="number" placeholder="请输入" class="commission-before-zhongjie">
</td>
<td>
<span class="span-width-90">成交价:</span>
<span class="commission-price-zhongjie">66666元</span>
</td>
</tr>
<!--案场费-->
<tr>
<td>
<span class="span-width-90">商铺号:</span>
<input type="text" placeholder="请输入" class="shop-num-liu">
</td>
<td>
<span class="span-width-90">业态/品牌:</span>
<input type="text" placeholder="请输入" class="shop-yetai-liu">
</td>
</tr>
<tr>
<td>
<span class="span-width-90">备注:</span>
<input type="text" placeholder="请输入" class="beizhu-liu">
</td>
<td>
</td>
</tr>
</table>
<div>
<div class="form-group full-width-100 full-pic-area">
<!--input上传图片-->
<div id="container_body_du">
<label>请选择一个图像文件:</label>
<button type="button btn2" class="btn btn-default">上传图片</button>
<input type="file" id="file_input_pic_liu"/>
<div id="container_body_img_area_liu"></div>
</div>
</div>
<ul class="img-pre-ul" id="xiangqing_pic_ul">
</ul>
</div>
<div class="tip-liu">
<p>图片上传规则:</p>
<p>意向金:意向金收条,居间协议,客户身份证正反面,转账记录,佣金确认书,现场图(须两位业务员在场)(共6项)</p>
<p>转定:定金收条,意向金收条,居间协议,房东身份证正反面,佣金确认书,现场图(须两位业务员在场)(共6项)</p>
<p>签约:居间协议,佣金确认书,租赁合同(只传首页和尾页),转账记录,收据,现场图(须两位业务员在场)(共6项)</p>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" id="save_zhongjiefei"> 提交 </button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
\ No newline at end of file
......@@ -388,9 +388,8 @@
</select>
<select class="form-control btn2 ld-Marheight" id="come_from">
<option value="-1">来源</option>
<option value="0">app</option>
<option value="1">智能pos机</option>
<option value="2">调整</option>
<option value="1">正常入账</option>
<option value="2">调整入账</option>
</select>
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="order_id" placeholder="带看ID" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="get_id" placeholder="收款ID" type="text" value="">
......@@ -411,7 +410,13 @@
<!--<span class="money_total_two fore-span ld-Marheight ">实付总额:</span><span id="money_total" class="money_total_two_shifu fore-span ld-Marheight">1268</span>元-->
<!--<span class="btn btn-info btn3 ld-Marheight" id="export" style="float:left">导出报表</span>-->
<!--<span class="btn btn-info btn3 ld-Marheight" id="count" style="float:left">统计</span>-->
<span class="money_total_two ld-Marheight " style="float:left">实付总额:</span><span style="float:left" id="money_total" class="money_total_two_shifu fore-span ld-Marheight">0元</span>
<br />
<span style="float: left;margin-left: 6px;font-size: 16px;margin-top: 6px;font-weight: 600;margin-bottom: 10px;">
收款总计:<span class="receiving-total-money"></span>(正常入账:<span class="receiving-total-normal"></span>元,调整入账<span class="receiving-total-adjusment"></span>元 ),
实付总计:<span class="real-pay-total"></span>(正常入账:<span class="real-pay-normal"></span>元,调整入账<span class="real-pay-adjusment"></span>元 )
</span>
<!--收款总计:45123元(正常入账:4512元,调整入账4512元)
实付总计:45123元(正常入账:4512元,调整入账4512元)-->
</form>
</td>
</tr>
......@@ -422,8 +427,6 @@
<th class="text-center">成交报告ID</th>
<th class="text-center">入账日期</th>
<th class="text-center">提交人</th>
<th class="text-center">对应业务员</th>
<th class="text-center">所属门店</th>
<th class="text-center">类型</th>
<th class="text-center">收款金额</th>
<th class="text-center">实付金额</th>
......
......@@ -449,16 +449,25 @@
<strong><span>4、入账日期:<span id="come_time"></span></span></strong>
</div>
<div class="col-xs-12 l">
<strong><span>5、商铺地址:<span id="check_addr"></span></span></strong>
<strong><span>5、该收款提交时间:<span id="pay_create_time"></span>&nbsp;(收款ID:<span id="pay_log_id"></span>)</span></strong>
</div>
<div class="col-xs-12 l">
<strong><span>6、退款原因:<span id="check_resaon"></span></span></strong>
<strong><span>6、商铺地址:<span id="check_addr"></span></span></strong>
</div>
<div class="col-xs-12 l">
<strong><span>7、退款方式:<span id="check_type"></span></span></strong>
<strong><span>7、商铺ID:<span id="house_id"></span></span></strong>
</div>
<div class="col-xs-12 l">
<strong><span>8、收款账户:<span id="card_no"></span></span></strong>
<strong><span>8、带看ID:<span id="order_id"></span></span></strong>
</div>
<div class="col-xs-12 l">
<strong><span>9、退款原因:<span id="check_resaon"></span></span></strong>
</div>
<div class="col-xs-12 l">
<strong><span>10、退款方式:<span id="check_type"></span></span></strong>
</div>
<div class="col-xs-12 l">
<strong><span>11、收款账户:<span id="card_no"></span></span></strong>
</div>
<div class="col-xs-12">
<div class="col-xs-12">
......@@ -644,6 +653,33 @@
</div>
<!-- /.modal -->
</div>
<!--时间轴-->
<div class="modal fade" id="modal-del" 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" class="iframe-div-parent">
<div style="font-size: 18px;padding: 20px;">确定删除该笔退款!!</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">取消
</button>
<button type="button" class="btn btn-primary" id="confirm_deleteMoney" data-dismiss="modal">
确定
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal -->
</div>
<div id="img_mask_area" title="点击任意位置可关闭">
<img />
</div>
\ No newline at end of file
{layout name="global/frame_two_tpl" /}
<input type="hidden" class="page-load" id="houseList" />
<style>
video{
outline: none;
}
.clear{
clear: both;
}
......@@ -610,6 +613,8 @@
<span class="btn-default-liu">盘方记录</span>
<span class="btn-default-liu">查看日志</span>
<span class="btn-default-liu">编辑日志</span>
<span class="btn-default-liu">商铺视频</span>
</h4>
</div>
<div class="modal-body modal-body-one" style="padding-top: 0;">
......@@ -682,6 +687,11 @@
<tbody class="text-center" id="caozuo_table_edit">
</table>
</div>
<div class="detail-modal-body-sec iframe-shop-detail-scroll">
<table>
<tbody class="text-center" id="shop-details-video">
</table>
</div>
</div>
</div>
......
{layout name="global/frame_two_tpl" /}
<input type="hidden" class="page-load" id="videoCheckList" />
<style>
video{
width: 260px;
height: 476px;
outline: none;
}
.modal-body {
/*height: 600px;*/
overflow-y: auto;
padding-bottom: 60px;
}
.user-ul2 {
width: 100%;
height: auto;
padding-bottom: 15px;
float: left;
}
.user-ul2 li {
list-style: none;
line-height: 30px;
}
.money_total_two {
font-weight: bold;
font-size: 15px;
}
#search {
float: left;
}
#reset {
float: left;
}
#district_id {
width: 16%!important;
}
#follow_up_con{
width: 32%!important;
}
.clear{
clear: both;
}
.btn-top-house{
margin-top: 20px;
text-align: center;
}
.ld-Marheight-city{
margin-top: 8px;
}
/*加载图标*/
#main_loading_pic {
position: fixed;
top: 50%;
left: 50%;
width: 100px;
height: 100px;
margin-left: 50px;
margin-top: -100px;
overflow: hidden;
display: none;
}
/*跟进人 下拉式搜索*/
.user-ul-liu{
height: auto;
float: left;
position: relative;
left: -40px;
}
.user-ul-liu li{
list-style: none;
line-height: 30px;
}
.left-phone-liu{
float: left;
margin-top: 7px;
margin-left: 10px;
}
</style>
<div id="page-content-wrapper">
<div class="container">
<div class="row">
<div class="">
<div class="panel panel-default">
<div class="panel-heading breadcrumb">
<li>
<a href="javascript:;">商铺视频</a>
</li>
</div>
<div class="panel-body">
<div class="table-responsive">
<table class="table table-striped table-bordered table-hover table-condensed">
<thead>
<tr>
<td colspan="10">
<form id="form_search">
<select class="form-control btn4 ld-Marheight input" name="" id="district_id">
<option value="">上传人所属部门</option>
</select>
<select class="form-control btn4 ld-Marheight input" name="" id="guest_stores" value="">
</select>
<select class="form-control btn4 ld-Marheight input" name="" id="guest_stores_agent" value="">
</select>
<div class="left-phone-liu">
<input class="form-control" data-rule-phoneus="false" data-rule-required="false" id="partical_name" placeholder="上传人姓名" type="text" value="">
<ul class="user-ul-liu"></ul>
</div>
<select class="form-control btn2 ld-Marheight" id="is_check">
<option value="0">是否审核过</option>
<option value="2"></option>
<option value="1"></option>
</select>
<input class="form-control btn2" data-rule-phoneus="false" data-rule-required="false" id="shop_id" placeholder="商铺ID" type="text" value="" style="margin-top: 7px;">
<div class="clear">
</div>
<span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="reset">重置</span>
</form>
</td>
</tr>
<tr>
<th class="text-center">上传时间</th>
<th class="text-center">上传人</th>
<th class="text-center">商铺ID</th>
<th class="text-center">是否审核通过</th>
<th class="text-center">操作</th>
</tr>
</thead>
<tbody class="text-center" id="shop_video_list">
</table>
</div>
<!-- /#page-content-wrapper -->
<div class="text-right" id="pagediv">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- #查看-->
<div class="modal fade modal_followup" id="modal_shop_detail" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-one">
<div class="modal-content" style="height: 699px;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
&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>
</h4>
</div>
<div class="modal-body modal-body-one">
<div class="detail-modal-body-sec">
<table>
<tbody class="text-center" id="shop-details-video">
</table>
</div>
<div class="detail-modal-body-sec">
<iframe class="iframe-shop-detail"></iframe>
</div>
</div>
</div>
</div>
</div>
<!--审核-->
<div class="modal fade modal_followup" id="modal_shop_check" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-one" style="width: 800px;">
<div class="modal-content" style="height: 699px;">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">
&times;
</button>
<h4 class="modal-title detail-modal-header-tab">
审核视频
</h4>
</div>
<div class="modal-body modal-body-one">
<div style="overflow: hidden;">
<div style="float: left; text-align: center;">
<span class="video-span"></span>
<!--<video src="/resource/image/liu.mp4" controls="controls" type="video/mp4" id="video-check" preload="none"></video>-->
<br />
<span class="text-danger delVideo" style="cursor: pointer;">删除</span>
</div>
<div style="float: left;margin-top: 80px;margin-left: 10px;">
<a class="btn btn-info checkVideo">审核通过</a>
<span class="text-danger">备注:视频将展示给客户看,请注意不要泄露位置!</span>
</div>
</div>
上传人:<span class="shop-name"></span> <br />
上传时间:<span class="shop-time"></span> <br />
审核人:<span class="shop-name-check"></span> <br />
审核时间:<span class="shop-time-check"></span>
</div>
</div>
</div>
</div>
<!--加载图标-->
<div id="main_loading_pic">
<img src="/resource/image/jz2.gif">
</div>
<?php
/**
* Created by PhpStorm.
* User: 43897
* Date: 2019/3/22
* Time: 14:23
*/
namespace app\model;
use think\Db;
class GHousesVideo extends BaseModel
{
// 设置当前模型对应的完整数据表名称
protected $table = 'g_houses_video';
private $db_;
public function __construct($data = [])
{
parent::__construct($data);
$this->db_ = Db::name($this->table);
}
/**
* @param $data
* @return int|string
*/
public function insertData($data)
{
if (is_array($data[0])) {
$num = $this->db_->insertAll($data);
} else {
$num = $this->db_->insert($data);
}
return $num;
}
/**
* @param $data
* @param $where
* @return int|string
* @throws \think\Exception
* @throws \think\exception\PDOException
*/
public function updateData($data, $where)
{
return $this->db_->where($where)->update($data);
}
public function getHouseVideoList($pageNo,$pageSize,$field,$params)
{
$order = "a.create_time desc";
$result = $this->db_
->field($field)
->alias('a')
->join('g_houses b', 'a.house_id = Houses.id', 'right')
->where($params)
->limit($pageSize)
->page($pageNo)
->order($order)
->select();
//dump($this->getLastSql());
return $result;
}
public function getHouseVideoListTotal($field,$params)
{
$order = "a.create_time desc";
$result = $this->db_
->field($field)
->alias('a')
->join('g_houses b', 'a.house_id = Houses.id', 'left')
->where($params)
->count();
//dump($this->getLastSql());
return $result;
}
public function getHouseVideo($field,$params)
{
$order = "create_time desc";
$result = $this->db_
->field($field)
->where($params)
->order($order)
->select();
//dump($this->getLastSql());
return $result;
}
/**
*
* @param int $pageNo
* @param int $pageSize
* @param string $order_
* @param string $field
* @param string $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getVideoAgentList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $params = '') {
return $this->field($field)->alias('a')
->join('a_agents b', 'a.upload_id = b.id', 'left')
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->select();
}
/**
* @param string $params
* @param string $field
* @return int|string
*/
public function getVideoAgentListTotal($params = '', $field = 'a.id') {
return $this->field($field)->alias('a')
->join('a_agents b', 'a.upload_id = b.id', 'left')
->where($params)
->count();
}
}
\ No newline at end of file
......@@ -257,10 +257,28 @@ class OBargainModel extends Model
$where_["a.father_id"] = $params["father_id"];
}
if (isset($params["keyword"])) {
if (!isset($params["type"]) && isset($params["keyword"])) {
$where_["b.user_phone|b.user_name|d.internal_address"] = array( "like", "%" . $params["keyword"] . "%" );
}
switch ((int)$params["type"]){ //1商铺id 2商铺地址 3成交报告id 4带看id 5客户id
case 1:
$where_["d.id"] = $params["keyword"];
break;
case 2:
$where_["d.internal_address"] = array("like" , "%" . trim($params['keyword']) . "%");
break;
case 3:
$where_["a.id"] = $params["keyword"];
break;
case 4:
$where_["c.id"] = $params["keyword"];
break;
case 5:
$where_["b.user_id"] = $params["keyword"];
break;
}
if (isset($params["id"])) {
$where_["a.id"] = $params["id"];
}
......
......@@ -396,6 +396,7 @@ class OPayLogModel extends Model
->sum($field);
}
big_log($this->getLastSql());
return $data;
}
......
......@@ -120,6 +120,9 @@ class ORefundModel extends Model{
if (isset($params["id"])) {
$where_["a.id"] = $params["id"];
}
if (isset($params["del"])) {
$where_["a.is_del"] = $params["del"];
}
return $this->db_
->field($filed)
......
......@@ -294,36 +294,25 @@ class OReportModel extends Model
$conditions[] = "aaa.order_id =".$params['order_id'];
}
//城市 '省'
if (!empty($params['province'])) {
$conditions[] = "aaa.province = {$params['province']}" ;
}
//城市 '市'
//城市
if (!empty($params['city'])) {
$conditions[] = "aaa.city = {$params['city']}" ;
$conditions[] = "aaa.city = '{$params['city']}'" ;
}
//城市 '所在区'
if (!empty($params['disc'])) {
$conditions[] = "aaa.disc = {$params['disc']}" ;
}
//商铺地址
if (!empty($params['internal_address'])) {
$conditions[] = "aaa.internal_address = {$params['internal_address']}" ;
$conditions[] = "aaa.internal_address LIKE '%".$params['internal_address']."%'";
}
//商铺ID
if (!empty($params['house_id'])) {
$conditions[] = "aaa.user_id = {$params['house_id']}" ;
if (!empty($params['shop_id'])) {
$conditions[] = "aaa.house_id = {$params['shop_id']}" ;
}
//客户ID
if (!empty($params['user_id'])) {
$conditions[] = "aaa.user_id = {$params['user_phone']}" ;
$conditions[] = "aaa.user_id = {$params['user_id']}" ;
}
......@@ -332,9 +321,9 @@ class OReportModel extends Model
if ($conditions) {
$where_params = 'WHERE ' . implode(" AND ", $conditions);
}
//
// dump($where_params);
// dump($params["type"]);
switch ($params["type"]) {
case 2:
$sql = "SELECT * FROM
......@@ -438,8 +427,7 @@ class OReportModel extends Model
$result = $this->db->query($sql);
return $result;
default:
$field = "a.id,a.user_id,a.report_agent_name,a.report_agent_phone,a.user_phone,a.user_name,a.predict_see_time,a.create_time,b.id as order_id,b.order_no,b.house_id,b.house_title,c.province,c.city,c.disc,c.internal_address";
$filed = "a.id,a.user_id,a.report_agent_name,a.report_agent_phone,a.user_phone,a.user_name,a.predict_see_time,a.create_time,b.id as order_id,b.order_no,b.house_id,b.house_title,c.province,c.city,c.disc,c.internal_address";
$sql = "SELECT * FROM
((SELECT
......@@ -465,8 +453,11 @@ class OReportModel extends Model
AND `b`.`is_del` = 0
) ) as aaa $where_params ORDER BY `create_time` DESC limit $start_index,$pageSize";
$result = $this->db->query($sql);
// dump($sql);
// dump($result);
// echo $this->getLastSql();
return $result;
}
......@@ -626,6 +617,8 @@ class OReportModel extends Model
$result = $this->db->query($sql);
return $result;
default:
$filed = "a.id,a.user_id,a.report_agent_name,a.report_agent_phone,a.user_phone,a.user_name,a.predict_see_time,a.create_time,b.id as order_id,b.order_no,b.house_id,b.house_title,c.province,c.city,c.disc,c.internal_address";
$sql = "SELECT count(1) as total FROM
((SELECT
$filed
......@@ -770,7 +763,7 @@ class OReportModel extends Model
}
/**
* @param int $pageNo
* @param int $pageNo 7151
* @param int $pageSize
* @param string $order_
* @param string $field
......@@ -1102,6 +1095,16 @@ class OReportModel extends Model
public function getFieldValue($field, $where) {
return $this->db->where($where)->value($field);
}
public function selectReportByIdTime($filed = "id", $params)
{
$params["status"] = 0;
return $this->db
->field($filed)
->where($params)
->select();
}
}
......
......@@ -125,6 +125,9 @@ Route::group('index', [
'getEditLog' => ['index/houses/getEditLog', ['method' => 'get']],//商铺修改日志
'isShow' => ['index/houses/isShow', ['method' => 'POST']],//是否对C端显示
'vipHouse' => ['index/houses/vipHouse', ['method' => 'POST']],//vip盘
'videoCheckList' => ['index/VideoCheck/videoCheckList', ['method' => 'GET']],//视频审核列表
'checkVideo' => ['index/VideoCheck/checkVideo', ['method' => 'POST']],//视频审核
'delVideo' => ['index/VideoCheck/checkVideo', ['method' => 'POST']],//视频删除
//版本管理
'version' => ['index/version/index', ['method' => 'get']],
......@@ -274,7 +277,7 @@ Route::group('index', [
'addReceiptImg' => ['index/Finance/addReceiptImg', ['method' => 'post|get']],//收款图片信息保存
'deleteReceiptImg' => ['index/Finance/deleteReceiptImg', ['method' => 'post|get']],//删除收款图片
'receiptImgList' => ['index/Finance/receiptImgList', ['method' => 'post|get']],//收款列表-收款图片列表
'getCollectionDetail' => ['index/Finance/getCollectionDetailV2', ['method' => 'post|get']],//收款详情
'getCollectionDetail' => ['index/Finance/getCollectionDetail', ['method' => 'post|get']],//收款详情
'getCollectionEdit' => ['index/Finance/getCollectionEdit', ['method' => 'post']],//收款修改保存
'collectingBill' => ['index/Finance/collectingBill', ['method' => 'post']],//收款
'getBeForNum' => ['index/Finance/getBeForNum', ['method' => 'get']],//getBeForNum
......@@ -286,6 +289,7 @@ Route::group('index', [
'refundPayLog' => ['index/Finance/refundPayLog', ['method' => 'POST']],//退款
'checkRefund' => ['index/Finance/checkRefund', ['method' => 'POST']],//退款审核
'refundDetail' => ['index/Finance/refundDetail', ['method' => 'GET']],//退款详情
'delRefund' => ['index/Finance/delRefund', ['method' => 'POST']],//删除退款
'recoveryBargain' => ['index/Finance/recoveryBargain', ['method' => 'POST']],//撤销列表-恢复成交报告
'performanceInfo' => ['index/PerformanceInfo/performanceInfo', ['method' => 'post|get']],//业绩明细
'getPerformanceInfoExcel' => ['index/PerformanceInfo/getPerformanceInfoExcel', ['method' => 'post|get']],//业绩明细
......@@ -433,6 +437,8 @@ Route::group('index', [
'userAccountBalanceList' => ['index/AccountBalance/userAccountBalanceList', ['method' => 'get|post']],
'check' => ['index/AccountBalance/check', ['method' => 'get|post']],
'videoCheckList' => ['index/VideoCheck/videoCheckList', ['method' => 'get|post']],
]);
......@@ -606,8 +612,8 @@ Route::group('task', [
'updateForActivityBegins' => ['task/UpdateActivityTask/updateForActivityBegins', ['method' => 'get']],
'updateCouponExpired' => ['task/UpdateCouponTask/updateCouponExpired', ['method' => 'get']],//超过有效期的券改过期
'killOutTimeSql' => ['task/KillOutTimeSql/killOutTimeSql', ['method' => 'get']],//超过有效期的券改过期
'delHouseVideo' => ['task/JobTask/delHouseVideo', ['method' => 'get']],//删除无效视频
]);
Route::group('broker', [
......@@ -667,12 +673,14 @@ Route::group('broker', [
'getCityInfoByMap' => ['api_broker/MapFindHouse/getCityInfoByMap', ['method' => 'get|post']],
'getShopDetail' => ['api_broker/Shop/getShopDetail', ['method' => 'get']],
'addShopFollowUp' => ['api_broker/Shop/addShopFollowUp', ['method' => 'post']], //新增商铺跟进记录
'addHouseVideo' => ['api_broker/Shop/addHouseVideo', ['method' => 'post']], //新增商铺视频
'houseVideoList' => ['api_broker/Shop/houseVideoList', ['method' => 'get']], //商铺视频列表
'checkVideo' => ['api_broker/Shop/checkVideo', ['method' => 'post']], //视频审核和删除
'reportList' => ['api_broker/Report/reportList', ['method' => 'get']],
'getCheckType' => ['api_broker/Report/getCheckType', ['method' => 'get|post']],
'reportListForPc' => ['api_broker/Report/reportListForPc', ['method' => 'get']],
'orderDetail' => ['api_broker/OrderLog/orderDetail', ['method' => 'get|post']],
'reportList' => [ 'api_broker/Report/reportList', [ 'method' => 'get' ] ],
'getCheckType' => [ 'api_broker/Report/getCheckType', [ 'method' => 'get|post' ] ],
'reportListForPc' => [ 'api_broker/Report/reportListForPc', [ 'method' => 'get' ] ],
'orderDetail' => [ 'api_broker/OrderLog/orderDetail', [ 'method' => 'get|post' ] ],
'token' => ['api_broker/broker/token', ['method' => 'get']],
......@@ -687,7 +695,7 @@ Route::group('broker', [
'bargainDetail' => ['api_broker/OrderLog/bargainDetail', ['method' => 'get|post']],
'searchAgents' => ['api_broker/OrderLog/searchAgents', ['method' => 'get']],
'searchBargainList' => ['api_broker/OrderLog/searchBargainList', ['method' => 'get']],
'searchBargainList' => ['api_broker/OrderLog/searchBargainList', ['method' => 'get|post']],
'searchBargainListByOrderId' => ['api_broker/OrderLog/searchBargainListByOrderId', ['method' => 'get']],
......@@ -695,6 +703,7 @@ Route::group('broker', [
'searchBargainAgents' => ['api_broker/OrderLog/searchBargainAgents', ['method' => 'get']],
'isBargainEnd' => ['api_broker/OrderLog/isBargainEnd', ['method' => 'get']],
'getCommission' => ['api_broker/OrderLog/getCommission', ['method' => 'GET|POST']],
'appAgentAuth' => ['api_broker/Report/appAgentAuth', ['method' => 'get']],
......
......@@ -5,6 +5,7 @@ namespace app\task\controller;
use app\index\service\ImageDepotService;
use app\model\GHouses;
use app\model\GHousesExt;
use app\model\GHousesVideo;
use app\model\GImageDepot;
use app\model\GLandlordPhone;
use think\Image;
......@@ -188,4 +189,36 @@ class JobTask
unset($save_data);
}
}
/**
* @throws \think\Exception
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\PDOException
*/
public function delHouseVideo()
{
set_time_limit(0);
$m_house_video = new GHousesVideo();
$where['is_del'] = 1;
$total = $m_house_video->getTotal($where);
$pageSize = 200;
$pageTotal = ceil($total / $pageSize);
$path = ROOT_PATH.'public/resource/lib/Attachments/video/';
for ($pageNo = 1; $pageNo <= $pageTotal; $pageNo++) {
$data = $m_house_video->getList($pageNo, $pageSize, '', 'id,video_name,video_image', $where);
foreach ($data as $k=>$v) {
$del_file = $path.$v['video_name'];
$del_file_img = $path.$v['video_image'];
@unlink($del_file);
@unlink($del_file_img);
if (!file_exists($del_file)) {
$m_house_video->updateData(['is_del'=>2], ['id'=>$v['id']]);
}
}
}
return ;
}
}
\ No newline at end of file
......@@ -23,4 +23,4 @@
if(!doc.addEventListener) return;
win.addEventListener(resizeEvt, recalc, false);
doc.addEventListener('DOMContentLoaded', recalc, false);
})(document, window);</script><link href=./static/css/app.9484d58794268174400945428257aad0.css rel=stylesheet></head><body><div id=app></div><script src=https://api.tonglianjituan.com/app/js/libs/vue.min.js></script><script src=https://api.tonglianjituan.com/app/js/libs/vue-router.min.js></script><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.1b35a927314506fe4a4f.js></script><script type=text/javascript src=./static/js/app.699733b35fef18da5ecb.js></script></body></html>
\ No newline at end of file
})(document, window);</script><link href=./static/css/app.b47eea8f23ae7d782907c33d77a7e49c.css rel=stylesheet></head><body><div id=app></div><script src=https://api.tonglianjituan.com/app/js/libs/vue.min.js></script><script src=https://api.tonglianjituan.com/app/js/libs/vue-router.min.js></script><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.1b35a927314506fe4a4f.js></script><script type=text/javascript src=./static/js/app.d4bc73ef5022e12a38c8.js></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This 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