Commit 3b5f7a17 authored by zw's avatar zw Committed by hujun

订单详情

parent 1adfdac8
......@@ -7,6 +7,7 @@ use app\api_broker\service\OrderLogService;
use app\model\OBargainModel;
use app\model\OMarchInModel;
use app\model\ORefundModel;
use think\Exception;
/**
* Created by PhpStorm.
......@@ -181,6 +182,33 @@ class OrderLog extends Basic
}
/**
* 详情页
* @return \think\Response
*/
public function orderDetail(){
$params = $this->params;
$params = array(
"order_id" => 1,
);
if(!isset($params["order_id"])){
return $this->response("101", "order_id不能为空");
}
$where_["order_id"] = $params["order_id"];
try{
$result = $this->service_->selectOrderDetail($where_);
if(count($result)>0){
return $this->response("200","request success",$result[0]);
}else{
return $this->response("200","request list is null",[]);
}
}catch (Exception $e){
return $this->response("101","request error,msg:".$e);
}
}
/**
* 报备时间轴
* @return \think\Response
......
......@@ -186,4 +186,5 @@ class Report extends Basic
}
}
\ No newline at end of file
......@@ -129,6 +129,22 @@ class OrderLogService
return $arr;
}
/**
* 订单详情主体信息
* @param $where_
* @return false|\PDOStatement|string|\think\Collection
*/
public function selectOrderDetail($where_){
$orderModel = new OrderModel();
$field = "a.id,a.order_no,a.house_id,a.house_title,b.user_id,b.user_name,b.user_phone";
$result = $orderModel->selectOrderDetail($field,$where_);
foreach ($result as $k=>$v){
$result[$k]["user_phone"] = preg_replace('/(\d{3})\d{4}(\d{4})/','$1****$2',$v["user_phone"]);
}
return $result;
}
/**
* 查询流程
* @param $order_no
......
......@@ -58,13 +58,36 @@ class OrderModel extends Model
* @param $ids
* @return false|\PDOStatement|string|\think\Collection
*/
public function selectSign($ids){
public function selectSign($ids)
{
return $this->db_
->field('id as order_id,1 as type')
->where("id","in",0)
->union('SELECT order_id,2 as type FROM o_march_in where order_id in ('.$ids.') group by order_id')
->union('SELECT order_id,3 as type FROM o_paylog where order_id in ('.$ids.') group by order_id')
->union('SELECT order_id,4 as type FROM o_bargain where order_id in ('.$ids.') group by order_id')
->where("id", "in", 0)
->union('SELECT order_id,2 as type FROM o_march_in where order_id in (' . $ids . ') group by order_id')
->union('SELECT order_id,3 as type FROM o_paylog where order_id in (' . $ids . ') group by order_id')
->union('SELECT order_id,4 as type FROM o_bargain where order_id in (' . $ids . ') group by order_id')
->select();
}
/**
* 订单详情主要信息
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public function selectOrderDetail($field, $params)
{
$where_ = [];
if (isset($params["order_id"])) {
$where_["a.id"] = $params["order_id"];
}
$where_["a.is_del"] = 0;
$where_["b.status"] = 0;
return $this->db_
->field($field)
->alias("a")
->join("o_report b", "a.f_id = b.id", "left")
->where($where_)
->select();
}
......
......@@ -283,7 +283,12 @@ Route::group('broker', [
//商铺
'getShopList' => ['api_broker/Shop/getShopList', [ 'method' => 'get|post' ] ],
'getShopDetail' => ['api_broker/Shop/getShopDetail', [ 'method' => 'get' ] ],
'reportList' => ['api_broker/Report/reportList', [ 'method' => 'get' ] ],
'orderDetail' => ['api_broker/OrderLog/orderDetail', [ 'method' => 'get|post' ] ],
'token' => ['api_broker/broker/token', [ 'method' => 'get' ] ],
'getAgentsByPhone' => ['api_broker/broker/getAgentsByPhone', [ 'method' => 'get' ] ],
'agentsPhone' => ['api_broker/CellPhone/agentsPhone', [ 'method' => 'get|post' ] ], //获取经纪人拨打界面手机号
......
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