作者 sgj
1 个管道 的构建 通过 耗费 0 秒

修改订单列表时间

@@ -173,18 +173,16 @@ class UsersController extends HomeBaseController{ @@ -173,18 +173,16 @@ class UsersController extends HomeBaseController{
173 public function getOrder(){ 173 public function getOrder(){
174 $users_id=$this->request->param('users_id'); 174 $users_id=$this->request->param('users_id');
175 $order=Db::name('order')->where(['users_id'=>$users_id])->paginate(8); 175 $order=Db::name('order')->where(['users_id'=>$users_id])->paginate(8);
176 - $data=$order->items();  
177 - foreach ($data as $k=>$v){ 176 + $data_info=$order->items();
  177 + foreach ($data_info as $k=>$v){
178 $time_info=$this->getTimeInfo($v['start_time'],$v['end_time']); 178 $time_info=$this->getTimeInfo($v['start_time'],$v['end_time']);
179 - $data[$k]=array_merge($data[$k],$time_info); 179 + $data[$k]=array_merge($data_info[$k],$time_info);
180 } 180 }
181 - dump($data);  
182 - exit;  
183 $data=[ 181 $data=[
184 'currentPage'=>$order->currentPage(), 182 'currentPage'=>$order->currentPage(),
185 'allPage' => $order->lastPage(), 183 'allPage' => $order->lastPage(),
186 'allData'=>$order->total(), 184 'allData'=>$order->total(),
187 - 'data'=>$order->items() 185 + 'data'=>$data_info
188 ]; 186 ];
189 $this->apiResponse(200,'success',$data); 187 $this->apiResponse(200,'success',$data);
190 } 188 }