作者 何书鹏
1 个管道 的构建 通过 耗费 4 秒

分页参数完善

... ... @@ -89,7 +89,7 @@ class Category extends Api
*/
public function goods()
{
$rows = $this->request->request('rows',config('paginate.list_rows'));// 每页条数
$rows = $this->request->request('rows',null);// 每页条数
$page = $this->request->request('page',1);// 页码
$category_id = $this->request->request('category_id');
$category = $this->model->get($category_id);
... ...
... ... @@ -107,7 +107,7 @@ class Index extends Api
*/
public function searchGoodsList()
{
$rows = $this->request->request('rows',config('paginate.list_rows'));// 每页条数
$rows = $this->request->request('rows',null);// 每页条数
$page = $this->request->request('page',1);// 页码
$keywords = $this->request->request('keywords','');
$list = Goods::getList(['goods_name'=>['like','%'.$keywords.'%']],$page,$rows);
... ... @@ -155,7 +155,7 @@ class Index extends Api
*/
public function goodsList()
{
$rows = $this->request->request('rows',config('paginate.list_rows'));// 每页条数
$rows = $this->request->request('rows',null);// 每页条数
$page = $this->request->request('page',1);// 页码
$category_id = $this->request->request('category_id');// 分类id
empty($category_id) && $this->error(__('参数不合法!'));
... ... @@ -185,7 +185,7 @@ class Index extends Api
*/
public function memberGoodsList()
{
$rows = $this->request->request('rows',config('paginate.list_rows'));// 每页条数
$rows = $this->request->request('rows',null);// 每页条数
$page = $this->request->request('page',1);// 页码
$list = Goods::getList(['ismember'=>'1'],$page,$rows);
// 返回结果
... ... @@ -248,7 +248,7 @@ class Index extends Api
public function appraiseList()
{
// 商品id
$rows = $this->request->request('rows',config('paginate.list_rows'));
$rows = $this->request->request('rows',null);
$page = $this->request->request('page',1);
$goods_id = $this->request->request('goods_id');
$list = \app\common\model\Appraise::getList(['goods_id'=>$goods_id],$page,$rows);
... ...
... ... @@ -177,7 +177,7 @@ class User extends Api
})
*/
public function scoreLog(){
$rows = $this->request->request('rows',config('paginate.list_rows'));// 每页条数
$rows = $this->request->request('rows',null);// 每页条数
$page = $this->request->request('page',1);// 页码
$list = $this->model->scoreLog($this->user['id'],$page,$rows);
$this->success(__('成功'),array_merge([
... ...
... ... @@ -36,7 +36,7 @@ class Appraise extends Model
/**
* 评价列表
*/
public static function getList($where,$page,$rows=15)
public static function getList($where,$page,$rows)
{
$list = self::with(['user'])
->where($where)
... ...
... ... @@ -80,7 +80,7 @@ class Goods extends Model
/**
* 商品列表
*/
public static function getList($where,$page,$rows=15)
public static function getList($where,$page,$rows)
{
$list = self::where('issale','1')
->where($where)
... ...
... ... @@ -54,7 +54,7 @@ class User extends Model
/**
* 积分记录
*/
public function scoreLog($user_id,$page,$rows=15)
public function scoreLog($user_id,$page,$rows)
{
$list = ScoreLog::where('user_id',$user_id)
->order(['createtime' => 'desc'])
... ...