Commit 23d685d9 authored by zw's avatar zw

report info

parent 12ef4039
......@@ -190,7 +190,10 @@ class OrderLogService
/**
* 查询流程 订单时间轴
* @param $order_id
* @return array
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function selectListByOrderNo($order_id)
{
......@@ -214,9 +217,10 @@ class OrderLogService
}
$report_id = $orderData[0]["f_id"];
$field_report = "id,report_agent_id,report_agent_phone,report_agent_name,report_store_id,user_id,user_phone,user_name,vehicle,intro,predict_see_time,create_time";
$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->selectReportById($field_report, [ "id" => $report_id ]);
$reportData = $oReportModel->selectReportInfoById($field_report, [ "id" => $report_id ]);
if (count($reportData) == 0) {
return [ "101", "报备记录未找到" ];
}
......
......@@ -81,6 +81,42 @@ class OReportModel extends Model
->select();
}
/**
* 查询报备信息
*
* @param string $filed
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function selectReportInfoById($filed = "id", $params)
{
$where_ = [];
if (isset($params["id"])) {
$where_["a.id"] = $params["id"];
}
if (isset($params["report_agent_id"])) {
$where_["a.report_agent_id"] = $params["report_agent_id"];
}
if (isset($params["report_store_id"])) {
$where_["a.report_store_id"] = $params["report_store_id"];
}
if (isset($params["user_id"])) {
$where_["a.user_id"] = $params["user_id"];
}
$where_["a.status"] = 0;
return $this->db
->field($filed)
->alias("a")
->join("a_store b","a.store_id=b.id","left")
->join("a_district c","a.district_id=c.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