Commit f9e38f98 authored by zw's avatar zw

订单搜索

parent 4dfc4e19
......@@ -186,24 +186,25 @@ class OrderLog extends Basic
* 详情页
* @return \think\Response
*/
public function orderDetail(){
public function orderDetail()
{
$params = $this->params;
/*$params = array(
"order_id" => 1,
);*/
if(!isset($params["order_id"])){
if (!isset($params["order_id"])) {
return $this->response("101", "order_id不能为空");
}
$where_["order_id"] = $params["order_id"];
try{
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",[]);
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);
} catch (Exception $e) {
return $this->response("101", "request error,msg:" . $e);
}
......@@ -215,15 +216,15 @@ class OrderLog extends Basic
*/
public function selectReportAll()
{
/* $params = $this->params;
$params = $this->params;
if (!isset($params["order_no"])) {
return $this->response("101", "请求参数错误");
}*/
$params = array(
}
/* $params = array(
"order_id" => 1,
);
);*/
$data = $this->service_->selectListByOrderNo($params["order_id"]);
return $this->response("200","request success",$data);
return $this->response("200", "request success", $data);
}
......@@ -258,25 +259,26 @@ class OrderLog extends Basic
}
}
public function searchOrder(){
public function searchOrder()
{
$params = $this->params;
/* $params = array(
"type" => 3, //1.客户姓名 2.报备人电话 3.报备人姓名 4.商铺名称 5.商铺地址
"agent_id"=>1,
"search_keyword" => "123"
);*/
if(!isset($params["type"]) || !isset($params["agent_id"]) || !isset($params["search_keyword"])){
return $this->response("101","请求参数错误");
if (!isset($params["type"]) || !isset($params["agent_id"]) || !isset($params["search_keyword"])) {
return $this->response("101", "请求参数错误");
}
try{
try {
$result = $this->service_->getSearchOrder($params);
if(count($result) > 0){
return $this->response("200","request success",$result);
}else{
return $this->response("200","request null");
if (count($result) > 0) {
return $this->response("200", "request success", $result);
} else {
return $this->response("200", "request null");
}
}catch (Exception $e){
return $this->response("101","request error,msg:".$e);
} catch (Exception $e) {
return $this->response("101", "request error,msg:" . $e);
}
......
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