Commit 98fba4c1 authored by clone's avatar clone

Merge branch '0731-v3.3.6' into test

# Conflicts: # application/api_broker/controller/Site.php
parents 2b3607b2 4de2138b
......@@ -49,7 +49,7 @@ class Site extends Basic
$user_id =$params['user_id'];
$site_id =$params['site_id'];
$res = $user_service->setUserSites($user_id, $site_id);
$res = $user_service->setUserSites($user_id, $site_id,$type = 0);
if ($res) {
return $this->response("200", "成功");
......
......@@ -126,6 +126,13 @@ class CollectHouse extends Basic
$get_params['agents_id'] = $params["agents_id"];
$get_params['CollectUser.status'] = 1;
if(empty($params["city"])){
$conditions["Houses.city"] = trim($this->city);
}else{
$conditions["Houses.city"] = $params["city"];
}
$res = $this->aCollectHouse->getCollectList($pageNo,$pageSize,$field,$get_params);
$res_total = $this->aCollectHouse->getCollectListTotal($field,$get_params);
$look_shop_service = new LookShopService();
......
......@@ -123,6 +123,11 @@ class CollectUser extends Basic
$get_params['CollectUser.status'] = 1;
$get_params['Users.entrust_type'] = isset($params["entrust_type"]) ? $params["entrust_type"] : 0;
// if (isset($params['site_id']) && $params['site_id']) {
// //城市筛选
// $get_params['Users.site_ids'] = [ 'LIKE', '%' . $params['site_id'] . '%' ];
// }
$res = $this->aCollectUser->getCollectList($pageNo,$pageSize,$field,$get_params);
$res_total = $this->aCollectUser->getCollectListTotal($field,$get_params);
foreach($res as $k=>$v)
......
......@@ -178,4 +178,7 @@ class DailyPaper extends Basic
return $this->response("200", "request null");
}
}
}
\ No newline at end of file
......@@ -132,6 +132,13 @@ class OfficeCollectHouse extends Basic
$get_params['agents_id'] = $params["agents_id"];
$get_params['CollectUser.status'] = 1;
if(empty($params["city"])){
$conditions["Houses.city"] = trim($this->city);
}else{
$conditions["Houses.city"] = $params["city"];
}
$res = $this->aCollectHouse->getCollectList($pageNo,$pageSize,$field,$get_params);
$res_total = $this->aCollectHouse->getCollectListTotal($field,$get_params);
$look_shop_service = new LookShopService();
......
......@@ -144,7 +144,7 @@ class OfficeOrderLog extends Basic{
$transfer_name = isset($params["transfer_name"]) ? $params["transfer_name"] : "";
$received_money = isset($params["received_money"]) ? $params["received_money"] : 0;
$type_ext = isset($params["type_ext"]) ? $params["type_ext"] : 0;
$is_open = isset($params['is_open']) ? $params['is_open'] : -1;
$is_open = isset($params['is_open']) ? $params['is_open'] : 0;
if ($pay_id > 0) {
$source = 2;
}
......
......@@ -4,6 +4,11 @@ namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\api_broker\service\OfficePayLogService;
use app\model\OfficeOImg;
use app\model\OfficeOPayLogModel;
use app\model\OfficeOrderModel;
use app\model\OfficeORefundLogModel;
use app\model\OfficeORefundModel;
use think\Request;
/**
......@@ -164,4 +169,100 @@ class OfficePayLog extends Basic
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 myRefundList()
{
$page_no = empty($this->params["page_no"]) ? 1 : $this->params["page_no"];
$page_size = empty($this->params["page_size"]) ? 2 : $this->params["page_size"];
if (empty($this->params['agent_id'])) {
return $this->response(101, '参数错误');
}
$where['agent_id'] = $this->params['agent_id'];
switch ($this->params['type']) {
case 1 :
$where['status'] = ['in', '0,1'];
break;
case 2 :
$where['status'] = 4;
break;
case 3 :
$where['status'] = 3;
break;
case 4 :
$where['status'] = 2;
break;
default :
return $this->response(101, '类型错误');
}
$field = 'id,create_time,agent_name,refund_money,order_id,pay_log_id,bank,card_no,name,remark,';
$field .= 'receipt_number,report_id,order_no,type,status';
$where['is_del'] = 0;
$m_refund = new OfficeORefundModel();
$m_pay = new OFficeOPayLogModel();
$m_order = new OfficeOrderModel();
$m_check_log = new OfficeORefundLogModel();
$m_img = new OfficeOImg();
$refund_data = $m_refund->getList($page_no, $page_size, 'ID DESC', $field, $where);
foreach ($refund_data as $k => $v) {
$refund_data[$k]['pay_create_time'] = $m_pay->getFieldValue('create_time', ['id' => $v['pay_log_id']]);
$house_data = $m_order->getHouseInfoByOrderIdOne('c.id,d.address', ['a.id' => $v['order_id']]);
if ($house_data) {
$refund_data[$k]['house_id'] = $house_data['id'];
$refund_data[$k]['house_address'] = $house_data['address'];
} else {
$refund_data[$k]['house_id'] = 0;
$refund_data[$k]['house_address'] = '';
}
$refund_data[$k]['image_array'] = $m_img->getImgList(['img_id' => $v['id'], 'img_type' => 3]);
$refund_data[$k]['check_log'] = $m_check_log->getListAll('create_time,operation_name', ['refund_id' => $v['id'], 'is_del' => 0]);
$refund_data[$k]['file_path'] = 'static/chat_image/';
if ($v['status'] == 2) {
$refund_data[$k]['transfer_image_array'] = $m_img->getImgList(['img_id' => $v['id'], 'img_type' => 4]);
} else {
$refund_data[$k]['transfer_image_array'] = [];
}
$refund_data[$k]['return_type'] = $this->params['type'];
}
return $this->response(200, '', $refund_data);
}
/*
* 保存退款图片
*/
public function uploadRefundImage()
{
if (empty($this->params['refund_id'])) {
return $this->response(101, '参数错误');
}
$remark_img = json_decode($this->params["remark_img"], true);
if (!is_array($remark_img)) {
return $this->response(101, '图片参数错误');
}
$id = $this->params['refund_id'];
$oImgModel = new OfficeOImg();
$result = $oImgModel->addImgAll($id, 3, $remark_img);
if ($result == 1) {
$code = 200;
} else {
$code = 101;
$msg = '保存图片失败';
}
return $this->response($code, $msg);
}
}
\ No newline at end of file
......@@ -292,6 +292,23 @@ class OfficeRoom extends Basic
return $this->response($this->code, $this->msg, $this->data);
}
/**
* 楼盘列表
* @return \think\Response
*/
public function getBuildingRoomH5()
{
header('Access-Control-Allow-Origin:*');
$result = $this->service->getRoomBuildingList($this->params);
if ($result['status'] == 'successful') {
$this->data = $result['data'];
} else {
$this->code = 101;
$this->msg = $result['msg'];
}
return $this->response($this->code, $this->msg, $this->data);
}
/**
* 约带看房源搜索
......@@ -356,6 +373,8 @@ class OfficeRoom extends Basic
*/
public function filtrateConditionRoom()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
if (empty($params["city"])) {
return $this->response("101", "参数错误");
......
......@@ -174,7 +174,7 @@ class OrderLog extends Basic
$transfer_name = isset($params["transfer_name"]) ? $params["transfer_name"] : "";
$received_money = isset($params["received_money"]) ? $params["received_money"] : 0;
$type_ext = isset($params["type_ext"]) ? $params["type_ext"] : 0;
$is_open = isset($params['is_open']) ? $params['is_open'] : -1;
$is_open = isset($params['is_open']) ? $params['is_open'] : 0;
if ($pay_id > 0) {
$source = 2;
}
......
......@@ -41,8 +41,8 @@ class PayLogOpen extends Basic
"house_id" => 1,
"intro" => "123123",
"house_address" => "123123",
"remark" => "123123",
"open_img" => "123123",
"type" => 1 //默认为1 单独申请开业 2和该地址相关的收款全部申请开业
);*/
$checkResult = $this->validate($params, "PayLogOpenValidate.applyForOpen");
......@@ -57,6 +57,7 @@ class PayLogOpen extends Basic
$house_id = $params["house_id"];
$house_address = $params["house_address"];
$intro = $params["intro"];
$type = $params["type"] ? $params["type"] : 1;
try {
$open_img = json_decode($params["open_img"], true);
} catch (Exception $exception) {
......@@ -64,7 +65,7 @@ class PayLogOpen extends Basic
}
$return_id = $this->service_->addApplyForOpen($pay_log_id, $report_id, $bargain_id, $agent_id, $house_id, $intro,
$house_address, $open_img, $order_id, $this->agentId);
$house_address, $open_img, $order_id, $this->agentId,$type);
if ($return_id > 0) {
return $this->response("200", "success", ["id" => $return_id]);
} elseif ($return_id == -1){
......
......@@ -277,9 +277,14 @@ class Shop extends Basic
//$conditions['status'] = array( 'in', "1,2" ); //只显示上架或下架的
$conditions['status'] = !empty($params['status']) ? $params['status'] : array('in', "1,2"); //只显示上架或下架的
}
if(!empty($params["site_name"])){
$conditions["city"] = $params["site_name"];
}
$result = $this->gHousesModel->getHousesList($pageNo, $pageSize, $order_, $field, $conditions, $spTagArr);
$m_business_district = new GBusinessDistrict();
// $m_business_district = new GBusinessDistrict();
//获取图片信息
foreach ($result as $key => $val) {
$result[$key]["api_path"] = CK_IMG_URL . 'images/';
......@@ -581,7 +586,7 @@ class Shop extends Basic
$result['landlord_phone'] = $m_landlord->getAllList('id,name,phone',['house_id'=>$params["id"], 'status'=>0]);
foreach ($result['landlord_phone'] as $kk=>$vv){
$result['landlord_phone'][$kk]['phone'] = substr_replace($result['landlord_phone'][$kk]['phone'], '****', 3, 4);
$result['landlord_phone'][$kk]['name'] = '(编号ID:'.$result['landlord_phone'][$kk]['id'].')'.$result['landlord_phone'][$kk]['name'];
$result['landlord_phone'][$kk]['name'] = '(房东ID:'.$result['landlord_phone'][$kk]['id'].')'.$result['landlord_phone'][$kk]['name'];
}
$result['is_show_landlord'] = 1;
} else {
......@@ -723,10 +728,54 @@ class Shop extends Basic
}
}
//案场权限人
$result['stronghold_info'] = $this->getExclusiveInfo($result['id']);
unset($result['external_image_id']);
return $this->response("200", 'request success', $result);
}
/**
* 案场权限人
* @param $house_id
* @return null|string
*/
public function getExclusiveInfo($house_id)
{
// $m_agent_house = new GHousesToAgents();
// $exclusive_info = [];
// $params['a.houses_id'] = $house_id;
// $params['a.type'] = $type;
// $params['a.is_del'] = 0;
// $res = $m_agent_house->getAgentsHouses('b.id,name,a.type,b.phone', $params);
// if ($res) {
// $exclusive_info['name'] = $res[0]['name'];
// $exclusive_info['phone'] = $res[0]['phone'];
// } else {
// return null;
// }
// return $exclusive_info ;
$houseToAgentModel = new GHousesToAgents();
$params["a.houses_id"] = $house_id;
$params["a.type"] = array("in", '1'); //案场权限人,盘方和独家
$params["a.is_del"] = 0;
$house_arr = $houseToAgentModel->getHouseNameByAgentId("b.name", $params);
$ids = "";
foreach ($house_arr as $item) {
$ids .= $item["name"] . ",";
}
$ids = rtrim($ids, ",");
if (!$ids) { //代表没有案场
return null;
}
return $ids;
}
/**
* 是否显示对内地址
* @param $panPartyArr
......
......@@ -94,7 +94,6 @@ class Site extends Basic
$get_params['b.is_del'] = 0;
$get_params['a.phone'] = $params["agent_phone"];
// $get_params['a.site_id'] = $params["site_id"]; //去除其它城市
$site_city = $this->aAgentModel->getAgentSiteList($get_params, $field);
return $this->response("200", "success", $site_city);
}
......
......@@ -66,6 +66,7 @@ class Basic extends Controller
"broker/moveHouseAgent",
"broker/moveHouseSiteId",
"office/filtrateConditionRoom",
"office/getBuildingRoomH5",
);
/**
......
......@@ -4,6 +4,7 @@ namespace app\api_broker\service;
use app\api_broker\controller\Agent;
use app\api_broker\service\VerifyService;
use app\index\controller\DailyUncommitted;
use app\model\AAgents;
use app\model\AStore;
use app\model\GHouses;
......@@ -636,6 +637,9 @@ class DailyPaperService
$tenpay_2, $alipay_2, $site_id, $bank_card, $bank_card_yun, $bank_card_lin, $bank_card_new);
$is_ok = $this->oDailyModel->addDaily($params);
if ($is_ok > 0) {
//更新财务日报未提交记录表数据
$c_daily_uncommitted = new DailyUncommitted();
$c_daily_uncommitted->updateUncommittedList($agent_info[0]["store_id"],$daily_date);
return ["code" => 200, "data" => null];
} else {
return ["code" => 101, "msg" => "审核异常"];
......
......@@ -39,28 +39,52 @@ class PayLogOpenService
* @param $open_img
* @param $order_id
* @param $operation_id
* @param $type
* @return int
* @throws \think\Exception
*/
public function addApplyForOpen($pay_log_id, $report_id, $bargain_id, $agent_id, $house_id, $intro, $house_address, $open_img, $order_id, $operation_id)
public function addApplyForOpen($pay_log_id, $report_id, $bargain_id, $agent_id, $house_id, $intro, $house_address,
$open_img, $order_id, $operation_id, $type)
{
$params["pay_log_id"] = $pay_log_id;
$params["agent_id"] = $agent_id;
$pay_open_data = $this->payLogOpenModel->getFind("id", 0, $params);
if($pay_open_data){
if ($pay_open_data) {
return -1;
}
$return_id = 0;
switch ($type) {
case 1:
$return_id = $this->payLogOpenModel->addPayLogOpen(
$this->payLogOpenBin($pay_log_id, $report_id, $bargain_id, $agent_id, $house_id, $intro, $house_address, $order_id)
);
//save img
if ($return_id > 0) {
$this->oImgModel->addImgAll($return_id, 5, $open_img);
}
break;
case 2:
//查询所有和改地址相关的未申请开业的收款
$where["b.house_id"] = $house_id;
$where["a.is_open"] = 0;
$where["a.is_del"] = 0;
$where["a.type"] = array("in", "91,92");
$payLogArr = $this->payLogModel->selectListByHouseId("a.id", $where);
foreach ($payLogArr as $item) {
$return_id = $this->payLogOpenModel->addPayLogOpen(
$this->payLogOpenBin($item["id"], $report_id, $bargain_id, $agent_id, $house_id, $intro, $house_address, $order_id)
);
if ($return_id > 0) {
$this->oImgModel->addImgAll($return_id, 5, $open_img);
}
}
}
//save img
if ($return_id > 0) {
//todo 推送
$verifyService = new VerifyService();
$leaderId = $verifyService->getLeaderIdByAgentId($agent_id);
if($leaderId > 0){
if ($leaderId > 0) {
$push_service = new PushMessageService();
$push_service->record(13, 0, [$leaderId], $operation_id, ['message' => "有业务员提交了开业申请,请及时审核"]);
}
......@@ -91,7 +115,7 @@ class PayLogOpenService
$this->payLogOpenModel->editData(['status' => $status], $open_id); //更新状态
if ($status == 3) {
$pay_log_id = $this->payLogOpenModel->getFieldOneValue('pay_log_id', ['id'=>$open_id]);
$pay_log_id = $this->payLogOpenModel->getFieldOneValue('pay_log_id', ['id' => $open_id]);
if ($pay_log_id) {
$update_data['id'] = $pay_log_id;
......@@ -180,7 +204,7 @@ class PayLogOpenService
$list[$key]["img_path"] = CHAT_IMG_URL;
$list[$key]["img_arr"] = $img_arr;
$log_list = $this->payLogOpenLogModel->getAllList($field_log, 0, ["open_id"=>$item["id"]]);
$log_list = $this->payLogOpenLogModel->getAllList($field_log, 0, ["open_id" => $item["id"]]);
$list[$key]["log_list"] = $log_list;
}
return $list;
......
......@@ -413,6 +413,18 @@ class PushMessageService
$title = '委托找铺';
$type = '';
break;
case 13:
$title = '开盘申请';
$type = '';
break;
case 14:
$title = '退款驳回';
$type = '';
break;
case 15:
$title = '财务日报提醒';
$type = '';
break;
}
$this->pushAgentAllDeviceId($v['addressee_id'], $title, $v['message'], $type, $id, $is_forbidden,$v['house_id'], $v['order_id']);
......
......@@ -114,7 +114,7 @@ class RedisCacheService
* @param $id
* @return bool
*/
public function delRedisCache($type, $id)
public function delRedisCache($type, $id = 0)
{
$result = 0;
switch ($type) {
......@@ -129,6 +129,13 @@ class RedisCacheService
break;
case 4 :
$result = $this->redis_ext->del($this->rule_key.$id);
break;
case 5 :
$result = $this->redis_ext->del($this->group_site_key.$id);
break;
case 6 :
$result = $this->redis_ext->del($this->site_city_all_key);
break;
}
return $result;
......@@ -235,8 +242,13 @@ class RedisCacheService
$m_auth_rule = new AuthRule();
$field = 'id,name,title,pid,is_menu';
$data = $m_auth_rule->getRule($field, ['name'=>$name,'status'=>0]);
if (!empty($data)) {
$this->setRedisCache($this->rule_key . $name, $data[0]);
$result = $data[0];
} else {
$result = [];
}
} catch (\Exception $e) {
$result = [];
}
......@@ -275,7 +287,10 @@ class RedisCacheService
if (empty($result)) {
$m_auth_rule = new ASite();
$result = $m_auth_rule->getSiteList();
if (!empty($result)) {
$this->setRedisCache($this->site_city_all_key, $result);
}
} else {
$result = json_decode($result, true);
}
......@@ -294,7 +309,9 @@ class RedisCacheService
if (empty($label_data)) {
$m_label = new ULabels();
$label_data = $m_label->getColumn('id,name', ['type'=>1]); //获取标签
if (!empty($label_data)) {
$this->setRedisCache($this->label_call_key, $label_data);
}
} else {
$label_data = json_decode($label_data, true);
}
......
......@@ -25,6 +25,7 @@ class PayLogOpenValidate extends Validate
'status' => 'require|number|in:1,2,3',
'operation_id' => 'require|number',
'operation_name' => 'require',
'open_img' => 'require',
];
protected $message = [
......@@ -50,10 +51,11 @@ class PayLogOpenValidate extends Validate
'operation_id.require' => '操作人id必填',
'operation_id.number' => '操作人id只能为数字',
'operation_name.require' => '操作人姓名必填',
'open_img.require' => '图片必填',
];
protected $scene = [
'applyForOpen' => ['pay_log_id', 'report_id', 'bargain_id', 'order_id', 'agent_id', 'house_id', 'house_address', 'intro'],
'applyForOpen' => ['pay_log_id', 'report_id', 'bargain_id', 'order_id', 'agent_id', 'house_id', 'house_address', 'intro','open_img'],
'openCheck' => ['open_id', 'status', 'operation_id', 'operation_name'],
];
}
\ No newline at end of file
......@@ -182,6 +182,10 @@ class Index
{
return view('index/timeline_pc_office');
}
public function timeline_pc_financial()
{
return view('index/timeline_pc_financial');
}
public function bargaininfo_detail_static_pc()
{
return view('index/bargaininfo_detail_static_pc');
......
......@@ -57,7 +57,7 @@
</li>
<li>
<div>楼盘号:</div>
<div>商铺号:</div>
<div>{{detailData.house_number}}</div>
</li>
<li>
......
......@@ -165,12 +165,22 @@
</div>
</td>
</tr>
<tr v-if="false">
<tr v-if="true">
<td colspan="4">
<div class="fl">案场权限人:</div>
<div class="fl">
<ul class="oh phone-list">
<li class="fl oh" v-for="(item, index) in d.panParty" :key="index" :data-id="item.phone">{{item.name+'-'+item.phone}}</li>
<li class="fl oh">{{d.stronghold_info}}</li>
</ul>
</div>
</td>
</tr>
<tr v-if="true">
<td colspan="4">
<div class="fl">上传人:</div>
<div class="fl">
<ul class="oh phone-list">
<li class="fl oh">{{d.upload_user}}</li>
</ul>
</div>
</td>
......
This diff is collapsed.
......@@ -587,7 +587,7 @@ class AppChat extends Basic
//获取此经纪人的所有盘方楼盘id
$param["addressee_id"] = $params["agent_id"];
$param["type"] = 8;
$param["type"] = ['in', '8,14'];
$msgModel = new MPushMessage();
$history_result = $msgModel->getListByWhere($field, $param, $page_no, $page_size);
......
<?php
namespace app\index\controller;
use app\index\extend\Basic;
use app\model\ODailyUncommittedModel;
use think\Request;
class DailyUncommitted extends Basic
{
private $m_daily_uncommitted;
public function __construct(Request $request = null)
{
parent::__construct($request);
$this->m_daily_uncommitted = new ODailyUncommittedModel();
}
/**
* 财务日报未提交 记录
* @return \think\Response
*/
public function DailyUncommittedList()
{
$params = $this->params;
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 10 : $this->params['pageSize'];
$conditions = [];
if (!empty($params['daily_date']) ) {
if(!checkTimeData($params['daily_date'])){
return $this->response("101", '非法时间');
}
$conditions['a.daily_date'] = $params['daily_date'];
}
if (!empty($params['store_id'])) {
$conditions['a.store_id'] = $params['store_id'];
}
$conditions['a.status'] = 0;
$field = 'a.daily_date,b.store_name';
$result = $this->m_daily_uncommitted->getDailyUncommittedList($field, $conditions, $pageNo, $pageSize);
if (!$result)
return $this->response("200", "成功", []);
$result_total = $this->m_daily_uncommitted->getDailyUncommittedTotal($field, $conditions);
$data['list'] = $result;
$data['total'] = $result_total;
return $this->response("200", "成功", $data);
}
/**
*
* @param $store_id
* @param $time
* @return bool
*/
public function updateUncommittedList($store_id,$time)
{
$params_d = [];
$params_d['store_id'] = $store_id;
$params_d['daily_date'] = $time;
$result = $this->m_daily_uncommitted->getDailyUncommitted('id',$params_d);
if ($result){
$this->m_daily_uncommitted->updateDailyUncommitted(['id'=>$result['id']],['status'=>1]);
}
return true;
}
}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -6,6 +6,7 @@ use app\index\extend\Basic;
use app\index\service\UserAgentService;
use app\index\service\UserSiteService;
use app\model\GImageDepot;
use app\model\OPayLogModel;
/**
* zhuwei
......@@ -178,6 +179,14 @@ class ImageDepot extends Basic
}
public function ceshi()
{
$m_pay_log = new OPayLogModel();
$pay_log_info = $m_pay_log->getPayLogByOrderId("b.house_id", ['id'=>1126]);
dump($pay_log_info[0]['house_id']);
}
}
......
......@@ -197,7 +197,7 @@ class OfficeBargain extends Basic
$order = 'a.id DESC';
$where['a.status'] = 10;
$where['a.audit_level'] = 0;
$excel_title .= '-第级审核';
$excel_title .= '-第级审核';
}
if (!empty($this->params['status'])) {
......@@ -318,14 +318,28 @@ class OfficeBargain extends Basic
$excel_data[$k]['house_number'] = $v['house_number'];
$excel_data[$k]['price'] = $v['price'];
$excel_data[$k]['submit_agent_name'] = $v['submit_agent_name'];
$excel_data[$k]['trade_type'] = array_key_exists($v['trade_type'], $trade_type_arr) ? $trade_type_arr[$v['labels_id']] : '其他';
$excel_data[$k]['trade_type'] = array_key_exists($v['trade_type'], $trade_type_arr) ? $trade_type_arr[$v['trade_type']] : '其他';
$excel_data[$k]['commission'] = $v['commission'];
$excel_data[$k]['income_money'] = $m_real->sumField('money',['bargain_id'=>$v['id'], 'is_del'=>0]);
$excel_data[$k]['subtract'] = $v['commission'] - $excel_data[$k]['income_money'];
$where_role[] = ['EXP', 'a.id = '.$v['id'].' OR a.father_id = '.$v['id']];
$where_role['a.status'] = ['<>', 30];
$where_role['a.role'] = 3;
$agent_data = $this->m_bargain->agentBargainAll('b.name', $where_role);
if ($agent_data) {
$name_string = '';
foreach ($agent_data as $vv) {
$name_string .= $vv['name'].',';
}
$excel_data[$k]['agent_name'] = rtrim($name_string, ',');
} else {
$excel_data[$k]['agent_name'] = '';
}
}
$export = new ExportExcelUntil();
$title = [ 'ID', '提交时间', '商铺地址', '商铺号', '成交价', '提交人', '成交类型', '应收佣金(元)','已收佣金(元)','未收佣金(元)' ];
$title = [ 'ID', '提交时间', '商铺地址', '商铺号', '成交价', '提交人', '成交类型', '应收佣金(元)','已收佣金(元)','未收佣金(元)', '反签方'];
$export->exportTable($excel_title, $excel_data, 11, $excel_title, $title);
}
}
......@@ -566,14 +580,14 @@ class OfficeBargain extends Basic
return $this->response(101, '参数错误');
}
$m_report = new OfficeOReportModel();
$m_user = new Users();
$user_id = $m_report->getFieldValue('user_id', ['id'=>$report_id]);
$id = $m_user->getUserByWhereValue('id', ['id'=>$user_id,'referrer_source'=>10,'status'=>0]);
// $m_report = new OfficeOReportModel();
// $m_user = new Users();
// $user_id = $m_report->getFieldValue('user_id', ['id'=>$report_id]);
// $id = $m_user->getUserByWhereValue('id', ['id'=>$user_id,'referrer_source'=>10,'status'=>0]);
$is_show = 0;
if ($id) {
$is_show = 1;
}
// if ($id) {
// $is_show = 1;
// }
return $this->response(200,'', ['is_show'=>$is_show]);
}
......
......@@ -6,6 +6,7 @@ namespace app\index\controller;
use app\api_broker\service\OfficeOrderLogService;
use app\api_broker\service\OfficePayLogService;
use app\api_broker\service\PushMessageService;
use app\api_broker\service\RedisCacheService;
use app\index\extend\Basic;
use app\index\untils\ExportExcelUntil;
......@@ -1131,6 +1132,7 @@ class OfficePayLog extends Basic
$field = 'id,img_name';
$order = new OfficeOImg();
$params_img['img_type'] = 2;
$res = $order->getImgList($params_img,$field);
foreach ($res as $k => $v) {
$res[$k]['img_name'] = CHAT_IMG_URL . $v['img_name'];
......@@ -2191,7 +2193,7 @@ class OfficePayLog extends Basic
}
$refund_where['is_del'] = $status = 0;
$refund_data = $m_refund->selectRefundByOrderNo('id,status,order_id', $refund_where);
$refund_data = $m_refund->selectRefundByOrderNo('id,status,order_id,agent_id', $refund_where);
if (empty($refund_data[0]['id'])) {
return $this->response($code, '没有该退款详情或审核完成');
......@@ -2252,6 +2254,13 @@ class OfficePayLog extends Basic
$save_data['status'] = $status = 4;
$m_refund_log->updateData(['is_del'=>1], ['refund_id'=>$this->params['refund_id'],'status'=>1,'is_del'=>0]);
$num = $m_refund_log->insertData($save_data);
$push = new PushMessageService();
$m_order = new OfficeOrderModel();
$house_title = $m_order->getOrderById('house_id,house_title', $refund_data[0]['order_id']);
$record_data['message'] = '['.$house_title['house_title'].']退款被驳回,驳回原因:'.$save_data['remark'];
$record_data['order_id'] = $refund_data[0]['order_id'];
$push->record(14, $house_title['house_id'], [$refund_data[0]['agent_id']],$this->userId, $record_data);
}
if ($num) {
......@@ -2355,7 +2364,7 @@ class OfficePayLog extends Basic
$transfer_name = isset($params["transfer_name"]) ? $params["transfer_name"] : "";
$received_money = isset($params["received_money"]) ? $params["received_money"] : 0;
$type_ext = isset($params["type_ext"]) ? $params["type_ext"] : 0;
$is_open = isset($params['is_open']) ? $params['is_open'] : -1;
$is_open = isset($params['is_open']) ? $params['is_open'] : 0;
if($pay_id > 0){
$source = 2;
}
......
......@@ -172,10 +172,15 @@ class PayLogOpen extends Basic
$list = $this->m_pay_open->getListCheck($pageNo, $pageSize, 'a.id desc', $fields, $where);
if ($this->params['excel'] == 0) {
//付款类型 10意向金 20定金 30保管金 40押金 50 租金 60 进场费 70转让费 80其他 90佣金 91中介费 92 案场费
$type_array = [
10=>'意向金', 20=>'定金',30=>'保管金',40=>'押金',50=>'租金',60=>'进场费',
70=>'转让费',80=>'其他',90=>'佣金',91=>'中介费',92=>'案场费'
];
$redis = new RedisCacheService();
$m_pay = new OPayLogModel();
if ($this->params['excel'] == 0) {
$m_daily = new ODaily();
$redis = new RedisCacheService();
foreach ($list as $k=>$v) {
$log_where['open_id'] = $v['id'];
$log_where['is_del'] = 0;
......@@ -191,19 +196,31 @@ class PayLogOpen extends Basic
}
$list[$k]['agent_name'] = $v['name'];
//跳转财务日报页面数据
$pay_data = $m_pay->selectPayLogByOrderNo('agent_id,create_time', ['id'=>$v['pay_log_id']]);
$pay_data = $m_pay->selectPayLogByOrderNo('agent_id,create_time,type', ['id'=>$v['pay_log_id']]);
$agent_data = $redis->getRedisCache(2, $pay_data[0]['agent_id']);
$daily_where['daily_date'] = date('Y-m-d', strtotime($pay_data[0]['create_time']));
$daily_where['store_id'] = $agent_data['store_id'];
$daily_where['is_del'] = 0;
$num = $m_daily->getTotal($daily_where); //是否提交财务日报
if ($num) {
$list[$k]['daily_date'] = date('Y-m-d', strtotime($pay_data[0]['create_time']));
$agent_data = $redis->getRedisCache(2, $pay_data[0]['agent_id']);
$list[$k]['store_id'] = $agent_data['store_id'];
$list[$k]['store_name'] = $agent_data['store_name'];
unset($agent_data);
} else {
$list[$k]['daily_date'] = '';
$list[$k]['store_id'] = '';
$list[$k]['store_name'] = '';
}
if (isset($pay_data[0])) {
$list[$k]['type_name'] = $type_array[$pay_data[0]['type']];
$agent_data = $redis->getRedisCache(2, $pay_data[0]['agent_id']);
$list[$k]['commit_pay_name'] = $agent_data['name'];
unset($agent_data);
} else {
$list[$k]['type_name'] = $list[$k]['commit_pay_name'] = '';
}
}
$data['list'] = $list;
$data['total'] = $this->m_pay_open->getListCheckTotal($where);
......@@ -226,11 +243,23 @@ class PayLogOpen extends Basic
$check_time = '';
}
$pay_data = $m_pay->selectPayLogByOrderNo('type,agent_id', ['id'=>$v['pay_log_id']]);
if ($pay_data[0]) {
$type_name = $type_array[$pay_data[0]['type']];
$agent_data = $redis->getRedisCache(2, $pay_data[0]['agent_id']);
$commit_pay_name = $agent_data['name'];
unset($agent_data);
} else {
$type_name = $commit_pay_name = '';
}
$excel_data[$k] = [
'id' => $v['id'],
'create_time' => $v['create_time'],
'agent_name' => $v['name'],
'pay_log_id' => $v['pay_log_id'],
'commit_pay_name' => $commit_pay_name,
'type_name' => $type_name,
'bargain_id' => $v['bargain_id'],
'order_id' => $v['order_id'],
'house_id' => $v['house_id'],
......@@ -242,7 +271,7 @@ class PayLogOpen extends Basic
}
$export = new ExportExcelUntil();
$title = [ '申请ID', '提交时间', '提交人', '收款ID', '成交报告ID', '带看订单ID', '成交商铺ID', '成交商铺地址', '状态', '总监通过时间', '开业确定时间'];
$title = [ '申请ID', '提交时间', '提交人', '收款ID', '收款提交人','收款类型','成交报告ID', '带看订单ID', '成交商铺ID', '成交商铺地址', '状态', '总监通过时间', '开业确定时间'];
$file_name = '收款开业审核-'.$status_string;
$export->exportTable($file_name, $excel_data, 11, '开业审核-'.$status_string, $title);
return true;
......@@ -265,14 +294,15 @@ class PayLogOpen extends Basic
$m_pay_open = new OPayLogOpen();
$where['is_del'] = 0;
$where['id'] = $this->params['open_id'];
$id = $m_pay_open->getFieldOneValue('id', $where);
if (empty($id)) {
$data = $m_pay_open->getFind('id,pay_log_id', $this->params['open_id'], $where);
if (empty($data)) {
return $this->response(101, '没有该数据');
}
$num = $m_pay_open->editData(['is_del'=>1], $id);
$num = $m_pay_open->editData(['is_del'=>1], $data['id']);
if ($num) {
$m_pay = new OPayLogModel();
$m_pay->updatePayLog(['id'=>$data['pay_log_id'],'is_open'=>0]);
$code = 200;
$msg = '删除成功';
}
......@@ -348,8 +378,8 @@ class PayLogOpen extends Basic
"house_id" => 1,
"intro" => "123123",
"house_address" => "123123",
"remark" => "123123",
"open_img" => "123123",
"type" => 1 //默认为1 单独申请开业 2和该地址相关的收款全部申请开业
);*/
$checkResult = $this->validate($params, "api_broker/PayLogOpenValidate.applyForOpen");
......@@ -366,6 +396,7 @@ class PayLogOpen extends Basic
$house_id = $params["house_id"];
$house_address = $params["house_address"];
$intro = $params["intro"];
$type = $params["type"] ? $params["type"] : 1;
try {
$open_img = json_decode($params["open_img"], true);
} catch (\Exception $exception) {
......@@ -373,7 +404,7 @@ class PayLogOpen extends Basic
}
$return_id = $service_->addApplyForOpen($pay_log_id, $report_id, $bargain_id, $agent_id, $house_id, $intro,
$house_address, $open_img, $order_id, $this->userId);
$house_address, $open_img, $order_id, $this->userId,$type);
if ($return_id > 0) {
return $this->response("200", "success", ["id" => $return_id]);
} elseif ($return_id == -1){
......@@ -417,5 +448,4 @@ class PayLogOpen extends Basic
return $this->response("101", "审核失败");
}
}
}
\ 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.
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