Commit cdd39cb7 authored by clone's avatar clone

1

parent b6913b64
...@@ -5,11 +5,14 @@ use app\api_broker\service\OfficeOrderLogService; ...@@ -5,11 +5,14 @@ use app\api_broker\service\OfficeOrderLogService;
use app\api_broker\service\OrderLogService; use app\api_broker\service\OrderLogService;
use app\api_broker\service\VerifyRepetitionService; use app\api_broker\service\VerifyRepetitionService;
use app\api_broker\service\VipService; use app\api_broker\service\VipService;
use app\model\AAgents;
use app\model\OfficeGRoom; use app\model\OfficeGRoom;
use app\model\OfficeOBargainModel; use app\model\OfficeOBargainModel;
use app\model\OfficeOImg; use app\model\OfficeOImg;
use app\model\OfficeOMarchInModel; use app\model\OfficeOMarchInModel;
use app\model\OfficeOrderModel;
use app\model\OMarchInModel; use app\model\OMarchInModel;
use think\Exception;
/** /**
* Created by PhpStorm. * Created by PhpStorm.
...@@ -670,7 +673,7 @@ class OfficeOrderLog extends Basic{ ...@@ -670,7 +673,7 @@ class OfficeOrderLog extends Basic{
return $this->response(101, 'Id or agent_id or source is null.'); return $this->response(101, 'Id or agent_id or source is null.');
} }
$source = empty($this->params['source']) ? 0 : $this->params['source']; $source = empty($this->params['source']) ? 0 : $this->params['source'];
$bargain = new OBargainModel(); $bargain = new OfficeOBargainModel();
$data['data'] = $bargain->addBargainCommission($this->params['id'], $this->agentId, $this->params['agent_id'], $data['data'] = $bargain->addBargainCommission($this->params['id'], $this->agentId, $this->params['agent_id'],
$this->params['role'], $this->params['scale_fee'], $this->params['scale'], $source); $this->params['role'], $this->params['scale_fee'], $this->params['scale'], $source);
...@@ -701,7 +704,7 @@ class OfficeOrderLog extends Basic{ ...@@ -701,7 +704,7 @@ class OfficeOrderLog extends Basic{
if (!isset($params["order_id"]) || !isset($params["submit_agent_id"])) { if (!isset($params["order_id"]) || !isset($params["submit_agent_id"])) {
return $this->response("101", "请求参数错误"); return $this->response("101", "请求参数错误");
} }
$bargainModel = new OBargainModel(); $bargainModel = new OfficeOBargainModel();
$where_["father_id"] = 0; $where_["father_id"] = 0;
$where_["order_id"] = $params["order_id"]; $where_["order_id"] = $params["order_id"];
$where_["submit_agent_id"] = $params["submit_agent_id"]; $where_["submit_agent_id"] = $params["submit_agent_id"];
...@@ -763,7 +766,7 @@ class OfficeOrderLog extends Basic{ ...@@ -763,7 +766,7 @@ class OfficeOrderLog extends Basic{
$where_["order_id"] = $params["order_id"]; $where_["order_id"] = $params["order_id"];
$where_["father_id"] = 0; $where_["father_id"] = 0;
$where_["account_statement"] = 0; $where_["account_statement"] = 0;
$oBargainModel = new OBargainModel(); $oBargainModel = new OfficeOBargainModel();
$data = $oBargainModel->selectBargainByOrderNo($field, $where_, "id desc"); $data = $oBargainModel->selectBargainByOrderNo($field, $where_, "id desc");
if (count($data) > 0) { if (count($data) > 0) {
$list["bargain_id"] = $data[0]["id"]; $list["bargain_id"] = $data[0]["id"];
...@@ -798,7 +801,7 @@ class OfficeOrderLog extends Basic{ ...@@ -798,7 +801,7 @@ class OfficeOrderLog extends Basic{
//todo 该商铺7日带看次数 //todo 该商铺7日带看次数
$model = new OrderModel(); $model = new OfficeOrderModel();
$params["house_id"] = $params['house_id']; $params["house_id"] = $params['house_id'];
$start_time = date("Y-m-d", strtotime("-7 day")); $start_time = date("Y-m-d", strtotime("-7 day"));
$end_time = date("Y-m-d", time()); $end_time = date("Y-m-d", time());
......
...@@ -13,7 +13,13 @@ use app\model\FollowUpLogModel; ...@@ -13,7 +13,13 @@ use app\model\FollowUpLogModel;
use app\model\GHousesFollowUp; use app\model\GHousesFollowUp;
use app\model\GHousesToAgents; use app\model\GHousesToAgents;
use app\model\OBargainModel; use app\model\OBargainModel;
use app\model\OfficeOBargainModel;
use app\model\OfficeOImg; use app\model\OfficeOImg;
use app\model\OfficeOMarchInModel;
use app\model\OfficeOPayLogModel;
use app\model\OfficeOrderModel;
use app\model\OfficeORefundModel;
use app\model\OfficeOReportModel;
use app\model\OImg; use app\model\OImg;
use app\model\OMarchInModel; use app\model\OMarchInModel;
use app\model\OPayLogAdjustment; use app\model\OPayLogAdjustment;
...@@ -38,8 +44,8 @@ class OfficeOrderLogService ...@@ -38,8 +44,8 @@ class OfficeOrderLogService
function __construct() function __construct()
{ {
$this->payLogModel = new OPayLogModel(); $this->payLogModel = new OfficeOPayLogModel();
$this->bargainModel = new OBargainModel(); $this->bargainModel = new OfficeOBargainModel();
$this->o_img_model = new OfficeOImg(); $this->o_img_model = new OfficeOImg();
} }
...@@ -407,7 +413,7 @@ class OfficeOrderLogService ...@@ -407,7 +413,7 @@ class OfficeOrderLogService
*/ */
public function selectOrderDetail($where_) public function selectOrderDetail($where_)
{ {
$orderModel = new OrderModel(); $orderModel = new OfficeOrderModel();
$field = "a.id,a.order_no,a.house_id,a.house_title,b.id as report_id,b.user_id,c.user_name as user_nick,c.user_phone, $field = "a.id,a.order_no,a.house_id,a.house_title,b.id as report_id,b.user_id,c.user_name as user_nick,c.user_phone,
c.user_pic,c.sex,d.internal_address as house_address"; c.user_pic,c.sex,d.internal_address as house_address";
$result = $orderModel->selectOrderDetail($field, $where_); $result = $orderModel->selectOrderDetail($field, $where_);
...@@ -434,13 +440,13 @@ class OfficeOrderLogService ...@@ -434,13 +440,13 @@ class OfficeOrderLogService
$sort = 0; $sort = 0;
//todo 1.验证订单是否存在 //todo 1.验证订单是否存在
$orderModel = new OrderModel(); $orderModel = new OfficeOrderModel();
$oReportModel = new OReportModel(); $oReportModel = new OfficeOReportModel();
$oMarchInModel = new OMarchInModel(); $oMarchInModel = new OfficeOMarchInModel();
$followUpLogModel = new FollowUpLogModel(); $followUpLogModel = new FollowUpLogModel();
$oPayLogModel = new OPayLogModel(); $oPayLogModel = new OfficeOPayLogModel();
$oRefundModel = new ORefundModel(); $oRefundModel = new OfficeORefundModel();
$oBargainModel = new OBargainModel(); $oBargainModel = new OfficeOBargainModel();
$orderData = $orderModel->selectOrderByOrderId("a.f_id,a.house_title,b.internal_address", ["order_id" => $order_id]); $orderData = $orderModel->selectOrderByOrderId("a.f_id,a.house_title,b.internal_address", ["order_id" => $order_id]);
...@@ -548,15 +554,15 @@ class OfficeOrderLogService ...@@ -548,15 +554,15 @@ class OfficeOrderLogService
$sort = 0; $sort = 0;
//todo 1.验证订单是否存在 //todo 1.验证订单是否存在
$orderModel = new OrderModel(); $orderModel = new OfficeOrderModel();
$oReportModel = new OReportModel(); $oReportModel = new OfficeOReportModel();
$oMarchInModel = new OMarchInModel(); $oMarchInModel = new OfficeOMarchInModel();
$followUpLogModel = new FollowUpLogModel(); $followUpLogModel = new FollowUpLogModel();
$oPayLogModel = new OPayLogModel(); $oPayLogModel = new OfficeOPayLogModel();
$oRefundModel = new ORefundModel(); $oRefundModel = new OfficeORefundModel();
$oBargainModel = new OBargainModel(); $oBargainModel = new OfficeOBargainModel();
$oPayLogAdjustmentModel = new OPayLogAdjustment(); $oPayLogAdjustmentModel = new OPayLogAdjustment();
$oRefundLogModel = new ORefundLogModel(); $oRefundLogModel = new OfficeORefundLoORefundLogModel();
$orderData = $orderModel->selectOrderByOrderId("a.f_id,a.house_title,b.internal_address", ["order_id" => $order_id]); $orderData = $orderModel->selectOrderByOrderId("a.f_id,a.house_title,b.internal_address", ["order_id" => $order_id]);
...@@ -671,7 +677,7 @@ class OfficeOrderLogService ...@@ -671,7 +677,7 @@ class OfficeOrderLogService
public function getOImg($id, $img_type) public function getOImg($id, $img_type)
{ {
//查询图片 //查询图片
$oImgModel = new OImg(); $oImgModel = new OfficeOImg();
$params["img_id"] = $id; $params["img_id"] = $id;
$params["img_type"] = $img_type; $params["img_type"] = $img_type;
$img_arr = $oImgModel->getImgList($params); $img_arr = $oImgModel->getImgList($params);
...@@ -691,7 +697,7 @@ class OfficeOrderLogService ...@@ -691,7 +697,7 @@ class OfficeOrderLogService
} }
foreach ($tree as $i => $v) { foreach ($tree as $i => $v) {
//查询图片 //查询图片
$oImgModel = new OImg(); $oImgModel = new OfficeOImg();
$params["img_id"] = $v[0]["father_id"]; $params["img_id"] = $v[0]["father_id"];
$params["img_type"] = 2; $params["img_type"] = 2;
$img_arr = $oImgModel->getImgList($params); $img_arr = $oImgModel->getImgList($params);
...@@ -753,12 +759,12 @@ class OfficeOrderLogService ...@@ -753,12 +759,12 @@ class OfficeOrderLogService
$sort = 0; $sort = 0;
//todo 1.验证订单是否存在 //todo 1.验证订单是否存在
$oReportModel = new OReportModel(); $oReportModel = new OfficeOReportModel();
$oMarchInModel = new OMarchInModel(); $oMarchInModel = new OfficeOMarchInModel();
$followUpLogModel = new FollowUpLogModel(); $followUpLogModel = new FollowUpLogModel();
$oPayLogModel = new OPayLogModel(); $oPayLogModel = new OfficeOPayLogModel();
$oRefundModel = new ORefundModel(); $oRefundModel = new OfficeORefundModel();
$oBargainModel = new OBargainModel(); $oBargainModel = new OfficeOBargainModel();
$uPhoneFollowModel = new UPhoneFollowUp($site_id); $uPhoneFollowModel = new UPhoneFollowUp($site_id);
$uPhoneFollowTempModel = new UPhoneFollowUpTemporary($site_id); $uPhoneFollowTempModel = new UPhoneFollowUpTemporary($site_id);
...@@ -945,34 +951,19 @@ class OfficeOrderLogService ...@@ -945,34 +951,19 @@ class OfficeOrderLogService
$sort = 0; $sort = 0;
//todo 1.验证订单是否存在 //todo 1.验证订单是否存在
$oReportModel = new OReportModel(); $oReportModel = new OfficeOReportModel();
$oMarchInModel = new OMarchInModel(); $oMarchInModel = new OfficeOMarchInModel();
$followUpLogModel = new FollowUpLogModel(); $followUpLogModel = new FollowUpLogModel();
$oPayLogModel = new OPayLogModel(); $oPayLogModel = new OfficeOPayLogModel();
$oRefundModel = new ORefundModel(); $oRefundModel = new OfficeORefundModel();
$oBargainModel = new OBargainModel(); $oBargainModel = new OfficeOBargainModel();
$appointWatchShopModel = new AppointWatchShop();
//客户c端提交预约看铺
$field_appoint = "a.id,a.create_time,b.user_name as name";
$appointData = $appointWatchShopModel->getAppointWatchOur(1, 15, "a.id desc", $field_appoint, ["a.user_id" => $user_id]);
if (count($appointData) > 0) {
foreach ($appointData as $k => $v) {
$v["step_name"] = "appoint";
$v["step"] = "提交预约看铺";
$result[$sort++] = $v;
}
}
$field_report = "a.id,a.create_time,a.predict_see_time,a.intro,b.id as order_id,b.house_id,b.house_title,c.id as agent_id,c.name,c.img,d.store_name"; $field_report = "a.id,a.create_time,a.predict_see_time,a.intro,b.id as order_id,b.house_id,b.house_title,c.id as agent_id,c.name,c.img,d.store_name";
$reportData = $oReportModel->selectReportByUserId($field_report, ["user_id" => $user_id]); $reportData = $oReportModel->selectReportByUserId($field_report, ["user_id" => $user_id]);
if (count($appointData) > 0 && count($reportData) <= 0) {
return $this->sortByTime($result);
} elseif (count($appointData) <= 0 && count($reportData) <= 0) {
return [];
}
$order_ids = $report_ids = ""; $order_ids = $report_ids = "";
...@@ -1270,7 +1261,7 @@ class OfficeOrderLogService ...@@ -1270,7 +1261,7 @@ class OfficeOrderLogService
$where_ .= " and a.house_id in ($ids)"; $where_ .= " and a.house_id in ($ids)";
$orderModel = new OrderModel(); $orderModel = new OfficeOrderModel();
$result = $orderModel->searchOrder($field, $condition, $where_, $pageNo, $pageSize); $result = $orderModel->searchOrder($field, $condition, $where_, $pageNo, $pageSize);
$reportService = new ReportService(); $reportService = new ReportService();
...@@ -1324,7 +1315,7 @@ class OfficeOrderLogService ...@@ -1324,7 +1315,7 @@ class OfficeOrderLogService
return ["code" => "101", "msg" => "搜索类型错误"]; return ["code" => "101", "msg" => "搜索类型错误"];
} }
$orderModel = new OrderModel(); $orderModel = new OfficeOrderModel();
$result = $orderModel->searchOrderAll($field, $condition, $pageNo, $pageSize); $result = $orderModel->searchOrderAll($field, $condition, $pageNo, $pageSize);
$reportService = new ReportService(); $reportService = new ReportService();
...@@ -1351,7 +1342,7 @@ class OfficeOrderLogService ...@@ -1351,7 +1342,7 @@ class OfficeOrderLogService
$ids = $aService->getAgentsByAgentId($agent_id); $ids = $aService->getAgentsByAgentId($agent_id);
$params["ids"] = $ids; $params["ids"] = $ids;
$bargainModel = new OBargainModel(); $bargainModel = new OfficeOBargainModel();
$filed = "a.id,a.father_id,a.house_number,a.price,a.commission,a.agent_id,a.create_time,b.user_phone, $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"; 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); $result = $bargainModel->selectBargainList($filed, $params, $pageNo, $pageSize);
...@@ -1386,7 +1377,7 @@ class OfficeOrderLogService ...@@ -1386,7 +1377,7 @@ class OfficeOrderLogService
{ {
$params["order_id"] = $order_id; $params["order_id"] = $order_id;
$bargainModel = new OBargainModel(); $bargainModel = new OfficeOBargainModel();
$filed = "a.id,a.father_id,a.price,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, $filed = "a.id,a.father_id,a.price,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,c.order_no,a.report_id"; d.id as house_id,d.internal_title,d.internal_address,c.order_no,a.report_id";
$result = $bargainModel->selectBargainList($filed, $params, 1, 15); $result = $bargainModel->selectBargainList($filed, $params, 1, 15);
...@@ -1468,7 +1459,7 @@ class OfficeOrderLogService ...@@ -1468,7 +1459,7 @@ class OfficeOrderLogService
public function getBargainDetail($params): array public function getBargainDetail($params): array
{ {
$bargainModel = new OBargainModel(); $bargainModel = new OfficeOBargainModel();
$bargain_info_filed = "a.id,a.house_number,a.account_time,a.account_statement,a.father_id,a.is_open,a.trade_type, $bargain_info_filed = "a.id,a.house_number,a.account_time,a.account_statement,a.father_id,a.is_open,a.trade_type,
a.price,a.industry_type,a.estimated_receipt_date,a.commission,c.id as house_id,c.internal_title,c.internal_address, a.price,a.industry_type,a.estimated_receipt_date,a.commission,c.id as house_id,c.internal_title,c.internal_address,
d.user_id,d.user_phone,d.user_name"; d.user_id,d.user_phone,d.user_name";
...@@ -1542,7 +1533,7 @@ class OfficeOrderLogService ...@@ -1542,7 +1533,7 @@ class OfficeOrderLogService
*/ */
public function userUpdateInfo($report_id) public function userUpdateInfo($report_id)
{ {
$reportModel = new OReportModel(); $reportModel = new OfficeOReportModel();
$filed = "id,user_id"; $filed = "id,user_id";
$params["id"] = $report_id; $params["id"] = $report_id;
$result = $reportModel->selectReportById($filed, $params); $result = $reportModel->selectReportById($filed, $params);
...@@ -1560,7 +1551,7 @@ class OfficeOrderLogService ...@@ -1560,7 +1551,7 @@ class OfficeOrderLogService
*/ */
public function searchBargainAgents($type, $order_id) public function searchBargainAgents($type, $order_id)
{ {
$orderModel = new OrderModel(); $orderModel = new OfficeOrderModel();
$field = "a.id,a.order_no,a.house_id,a.house_title,b.id as report_id,b.user_id,c.user_nick,c.user_phone, $field = "a.id,a.order_no,a.house_id,a.house_title,b.id as report_id,b.user_id,c.user_nick,c.user_phone,
c.user_pic,c.sex"; c.user_pic,c.sex";
$where_["order_id"] = $order_id; $where_["order_id"] = $order_id;
...@@ -1586,7 +1577,7 @@ class OfficeOrderLogService ...@@ -1586,7 +1577,7 @@ class OfficeOrderLogService
$list = $userModel->getAgentByUserId($field, $params); $list = $userModel->getAgentByUserId($field, $params);
break; break;
case 3: //反签 == 报备人 case 3: //反签 == 报备人
$reportModel = new OReportModel(); $reportModel = new OfficeOReportModel();
$params["a.id"] = $result[0]["report_id"]; $params["a.id"] = $result[0]["report_id"];
$params["b.status"] = 0; $params["b.status"] = 0;
$list = $reportModel->getAgentByOrderId($field, $params); $list = $reportModel->getAgentByOrderId($field, $params);
...@@ -1630,7 +1621,7 @@ class OfficeOrderLogService ...@@ -1630,7 +1621,7 @@ class OfficeOrderLogService
*/ */
public function searchBargainAllAgents($order_id) public function searchBargainAllAgents($order_id)
{ {
$orderModel = new OrderModel(); $orderModel = new OfficeOrderModel();
$field = "a.id,a.order_no,a.house_id,a.house_title,b.id as report_id,b.user_id,c.user_nick,c.user_phone, $field = "a.id,a.order_no,a.house_id,a.house_title,b.id as report_id,b.user_id,c.user_nick,c.user_phone,
c.user_pic,c.sex"; c.user_pic,c.sex";
$where_["order_id"] = $order_id; $where_["order_id"] = $order_id;
...@@ -1683,7 +1674,7 @@ class OfficeOrderLogService ...@@ -1683,7 +1674,7 @@ class OfficeOrderLogService
$key++; $key++;
} }
$reportModel = new OReportModel(); $reportModel = new OfficeOReportModel();
$params["a.id"] = $result[0]["report_id"]; $params["a.id"] = $result[0]["report_id"];
$params["b.status"] = 0; $params["b.status"] = 0;
$report_data = $reportModel->getAgentByOrderId($field, $params); $report_data = $reportModel->getAgentByOrderId($field, $params);
......
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