order(['id'=>'desc']) ->withoutField('update_time,delete_time') ->limit($this->limitOffset, $this->limitLength) ->select() ->toArray(); foreach ($lists as $key => $value){ if(0 == $value['taxi']){ $lists[$key]['start_km'] = 0; $lists[$key]['start_price'] = 0; $lists[$key]['continue_price'] = 0; } if(0 == $value['bus']){ $lists[$key]['bus_start_time'] = 0; $lists[$key]['bus_end_time'] = 0; $lists[$key]['bus_fare'] = 0; } } return $lists; } /** * @notes 服务分类数量 * @return int * @author ljj * @date 2022/2/8 3:51 下午 */ public function count(): int { return (new City())->count(); } }