Files
fast/addons/shopro/controller/zy/Gym.php

28 lines
649 B
PHP

<?php
namespace addons\shopro\controller\zy;
class Gym extends Base
{
protected $noNeedRight = ['*'];
public function __construct()
{
$this->model = new \app\admin\model\zy\Stadium;
parent::__construct();
}
public function index()
{
$params = $this->request->param();
$query = $this->model->where('status', 1);
if (isset($params['name'])) {
$query->where('name', 'like', '%' . $params['name'] . '%');
}
$res = $query->paginate($params['pageSize'] ?? 10);
$this->success('Success', ['list' => $res->items(), 'count' => $res->total()]);
}
}