| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
- namespace app\api\controller\v1;
- use app\api\controller\ApiController;
- use app\api\service\JWTAuth as IAuth;
- use think\App;
- class TaxiServiceCategory extends ApiController
- {
- protected $model;
- public function __construct(App $app = null, IAuth $auth)
- {
- parent::__construct($app, $auth);
- $this->model = new \app\common\model\TaxiServiceCategory();
- }
- public function index()
- {
- $params = input();
- $params['page'] = input('page/d', 1);
- $params['limit'] = input('limit/d', 10);
- $list = $this->model->field('id,name,image,url,type')
- ->where('status', 1)
- ->page($params['page'], $params['limit'])
- ->select();
- if ($list) {
- foreach ($list as $item) {
- $image = json_decode($item['image'], true);
- $item->image = implode(',', $image);
- }
- }
- return $this->ApiJson(0,'成功', $list);
- }
- }
|