Commit 89f6071f authored by clone's avatar clone

1

parent b31af223
......@@ -396,27 +396,6 @@ class OfficeOrderLog extends Basic{
return $this->response("200", "request success", $data);
}
/**
* 报备时间轴
*
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function selectReportAllV2()
{
$params = $this->params;
/* $params = array(
"order_id" => 38024,
);*/
if (!isset($params["order_id"])) {
return $this->response("101", "请求参数错误");
}
$data = $this->service_->selectListByOrderNo($params["order_id"]);
return $this->response("200", "request success", $data);
}
/**
* 修改成单状态
......
......@@ -10,6 +10,7 @@ namespace app\api_broker\service;
use app\model\AAgents;
use app\model\FollowUpLogModel;
use app\model\OfficeFollowUpLogModel;
use app\model\OfficeGHousesFollowUp;
use app\model\OfficeGRoom;
use app\model\OfficeGRoomToAgent;
......@@ -19,6 +20,7 @@ use app\model\OfficeOMarchInModel;
use app\model\OfficeOPayLogAdjustment;
use app\model\OfficeOPayLogModel;
use app\model\OfficeOrderModel;
use app\model\OfficeORefundLogModel;
use app\model\OfficeORefundModel;
use app\model\OfficeOReportModel;
use app\model\ORealIncome;
......@@ -420,119 +422,6 @@ class OfficeOrderLogService
return $result;
}
/**
* 查询流程 订单时间轴
* @param $order_id
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function selectListByOrderNoV2($order_id)
{
$result = [];
$sort = 0;
//todo 1.验证订单是否存在
$orderModel = new OfficeOrderModel();
$oReportModel = new OfficeOReportModel();
$oMarchInModel = new OfficeOMarchInModel();
$followUpLogModel = new FollowUpLogModel();
$oPayLogModel = new OfficeOPayLogModel();
$oRefundModel = new OfficeORefundModel();
$oBargainModel = new OfficeOBargainModel();
$orderData = $orderModel->selectOrderByOrderId("a.f_id,a.house_title,c.address as internal_address", ["order_id" => $order_id]);
//dump($orderData);
if (count($orderData) <= 0) {
return ["101", "找不到此订单编号"];
}
$report_id = $orderData[0]["f_id"];
$field_report = "a.id,a.report_agent_id,a.report_agent_phone,a.report_agent_name,a.report_store_id,
a.user_id,a.user_phone,a.user_name,a.vehicle,a.intro,a.predict_see_time,a.create_time,b.store_name,c.district_name";
$reportData = $oReportModel->selectReportInfoById($field_report, ["id" => $report_id]);
if (count($reportData) == 0) {
return ["101", "报备记录未找到"];
}
//报备
$reportData[0]["step_name"] = "report";
$reportData[0]["house_title"] = $orderData[0]["house_title"];
$reportData[0]["internal_address"] = $orderData[0]["internal_address"];
$result[$sort++] = $reportData[0];
//进场 march in
$field_march_in = "id,reception_id,reception_name,report_id,order_no,march_in_remark,march_in_img,march_in_area,create_time";
$marchInData = $oMarchInModel->selectMarchInByOrderNo($field_march_in, ["order_id" => $order_id]);
if (count($marchInData) > 0) {
/* foreach ($marchInData as $k => $v) {
$v["step_name"] = "march_in";
$v["img_path"] = CHAT_IMG_URL;
$result[$sort++] = $v;
}*/
foreach ($marchInData as $k => $v) {
$v["step_name"] = "march_in";
$v["img_path"] = CHAT_IMG_URL;
$v["img"] = $this->getOImg($v["id"], 1);
$result[$sort++] = $v;
}
}
//跟进
$field_follow_up = "id,agent_id,agent_name,user_type,decision_maker,industry_type,area_requirement,price_requirement,province,city,
district,business_area,explain,explain_img,create_time";
$followUpLogData = $followUpLogModel->selectFollowUpListByReportId($field_follow_up, ["report_id" => $report_id]);
if (count($followUpLogData) > 0) {
foreach ($followUpLogData as $k => $v) {
$v["step_name"] = "follow_up_log";
$v = $this->convertFollowUp($v);
$v["img_path"] = CHAT_IMG_URL;
$result[$sort++] = $v;
}
}
//收款
$field_pay_log = "id,order_no,father_id,order_id,agent_id,agent_name,type,pay_type,money,house_number,industry_type,
remark,transfer_img,real_money,source,create_time";
$payLogData = $oPayLogModel->selectPayLogByOrderNo($field_pay_log, ["order_id" => $order_id]);
if (count($payLogData) > 0) {
$sortPayLogData = $this->arr2tree($payLogData);
foreach ($sortPayLogData as $k => $v) {
$v["step_name"] = "pay_log";
$v["img_path"] = CHAT_IMG_URL;
$result[$sort++] = $v;
}
}
//退款
$field_refund = "id,report_id,agent_id,agent_name,order_no,order_id,refund_money,status,name,bank,card_no,
remark,remark_img,create_time";
$refundData = $oRefundModel->selectRefundByOrderNo($field_refund, ["order_id" => $order_id]);
if (count($refundData) > 0) {
foreach ($refundData as $k => $v) {
$v["step_name"] = "refund";
$v["img_path"] = CHAT_IMG_URL;
$result[$sort++] = $v;
}
}
//成交报告
$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]);
if (count($bargainData) > 0) {
$bargain_data_arr = $this->arr2TreeBargain($bargainData);
foreach ($bargain_data_arr as $k2 => $v2) {
$v2["step_name"] = "bargain";
$result[$sort++] = $v2;
}
}
return $this->sortByTime($result);
}
/**
* 查询流程 订单时间轴
......@@ -551,12 +440,12 @@ class OfficeOrderLogService
$orderModel = new OfficeOrderModel();
$oReportModel = new OfficeOReportModel();
$oMarchInModel = new OfficeOMarchInModel();
$followUpLogModel = new FollowUpLogModel();
$followUpLogModel = new OfficeFollowUpLogModel();
$oPayLogModel = new OfficeOPayLogModel();
$oRefundModel = new OfficeORefundModel();
$oBargainModel = new OfficeOBargainModel();
$oPayLogAdjustmentModel = new OfficeOPayLogAdjustment();
// $oRefundLogModel = new OfficeORefundLogRefundLogModel();
$oRefundLogModel = new OfficeORefundLogModel();
$orderData = $orderModel->selectOrderByOrderId("a.f_id,c.title,c.address,b.room_number", ["order_id" => $order_id]);
//dump($orderData);
......@@ -651,7 +540,7 @@ class OfficeOrderLogService
}
}
//退款审核
/* $field_turn_down = "id,refund_id,status,remark,operation_id,operation_name,create_time";
$field_turn_down = "id,refund_id,status,remark,operation_id,operation_name,create_time";
$turn_down["order_id"] = $order_id;
$turn_down["status"] = array("in", ("2,4"));
$turn_down["is_del"] = 0;
......@@ -663,7 +552,7 @@ class OfficeOrderLogService
$v2["img"] = $this->getOImg($v2["id"], 4);
$result[$sort++] = $v2;
}
}*/
}
return $this->sortByTime($result);
}
......
......@@ -107,7 +107,7 @@ class OfficeFollowUpLogModel extends Model
->alias("a")
->join("a_agents b","a.agent_id = b.id","left")
->join("a_store c","b.store_id = c.id","left")
->join("o_report d","a.report_id = d.id","left")
->join("office_o_report d","a.report_id = d.id","left")
->where($where_)
->select();
}
......
......@@ -127,7 +127,7 @@ class OfficeORefundModel extends Model{
return $this->db_
->field($filed)
->alias("a")
->join("o_paylog b","a.pay_log_id = b.id","left")
->join("office_o_paylog b","a.pay_log_id = b.id","left")
->where($where_)
->select();
}
......
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