From 75e3161d511c412eb26f64ada4a569bd0747666d Mon Sep 17 00:00:00 2001 From: tanghuijun <1953248054@qq.com> Date: Fri, 17 Jun 2022 16:25:21 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=86=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=93=8D=E5=BA=94=E5=BC=8F=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/api/controller/Goods.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/api/controller/Goods.php b/app/api/controller/Goods.php index cddd75e..ac82077 100644 --- a/app/api/controller/Goods.php +++ b/app/api/controller/Goods.php @@ -79,15 +79,18 @@ class Goods extends Base public function searchGoods(){ try { // todo 被请求委托查询 接口 + $start_time = microtime(true); //响应式开始计时 $this->checkVaild($this->valid, 'searchGoods', 'post'); $post = $this->request->post(['entrust_time', 'record_type', 'entrust_user_name', 'authorization', 'pay_type', 'entrust_name', 'entrust_islicode', 'goods_islicode', 'source_type', 'order_type', 'order', 'goods_status', 'page', 'limit']); $goodsService = new GoodsService(); $this->apilog->info("查询委托信息接口", $post); $result = $goodsService->searchGoods($post); - return _success('成功', $result); + $end_time = microtime(true); //响应式结束计时 + $userTime = $end_time-$start_time.'s'; + echo json_encode(['code'=>'success', 'msg'=>'成功', 'userTime'=>$userTime, 'data'=>$result]); exit(); }catch(\Exception $e){ - return _error($e->getMessage(), $e->getCode() ?: 400, $e); + echo json_encode(['code'=>'failure', 'msg'=>'请求失败']); exit(); } } /**