作者 景龙
1 个管道 的构建 通过 耗费 1 秒

修改列表倒序排序

... ... @@ -40,6 +40,7 @@ class Abouts extends Api
if($this->request->isGet()){
$data = Db::table('gc_about')
->field('id,description,image,lng,lat')
->order('id desc')
->find();
$this->success('成功',$data);
}else{
... ...
... ... @@ -104,6 +104,7 @@ class Cars extends Api
->join('gc_user u','p.uid = u.id','LEFT')
->where(['c.uid'=>$this->user_id,'p.status'=>$this->normal,'u.status'=>'normal'])
->field('c.id,c.p_id,p.title,p.price,c.num,p.images')
->order('c.id desc')
->select();
$this->success('成功',$data);
}else{
... ...
... ... @@ -114,6 +114,7 @@ class Comments extends Api
->where(['c.p_id'=>$goods_id,'u.status'=>'normal'])
->page($page,$limit)
->field('c.id,u.nickname,u.avatar,c.content,c.num,c.createtime')
->order('c.id desc')
->select();
foreach($data as &$value){
$value['createtime'] = date('Y-m-d',$value['createtime']);
... ...
... ... @@ -68,6 +68,7 @@ class Gifts extends Api
->where(['status'=>$this->normal])
->page($page,$limit)
->field('id,title,score,images')
->order('id desc')
->select();
$this->success('成功', ['my_score'=>$myScore['score'],'data'=>$data]);
}else{
... ...
... ... @@ -72,6 +72,7 @@ class Goods extends Api
->where(['p.category_id'=>$category_id,'p.status'=>$this->normal,'u.status'=>'normal'])
->page($page,$limit)
->field('p.id,u.type,p.title,u.address,p.pre_time,p.images')
->order('p.id desc')
->select();
foreach($data as &$value){
$value['pre_time'] = date('Y-m-d H:i:s',$value['pre_time']);
... ... @@ -171,6 +172,7 @@ class Goods extends Api
$data = Db::table('gc_search')
->where(['uid'=>$this->user_id])
->field('id,keywords')
->order('id desc')
->select();
$this->success('成功', $data);
}else{
... ... @@ -309,6 +311,7 @@ class Goods extends Api
->where($where)
->field('p.id,p.title,p.price,p.images')
->limit(20)
->order('p.id desc')
->select();
$this->success('成功', $data);
}else{
... ...
... ... @@ -242,6 +242,7 @@ class Gorders extends Api
->where(['o.uid'=>$this->user_id,'g.status'=>$this->normal,'u.status'=>'normal'])
->page($page,$limit)
->field('o.id,o.order_sn,u.username,g.title,o.num,o.createtime')
->order('o.id desc')
->select();
foreach($data as &$value){
$value['createtime'] = date('Y-m-d',$value['createtime']);
... ...
... ... @@ -45,6 +45,7 @@ class Index extends Api
$data = Db::table('gc_category')
->where(['status'=>'normal'])
->field('id,name,image')
->order('id desc')
->select();
$this->success('成功', $data);
}else{
... ... @@ -78,6 +79,7 @@ class Index extends Api
if($this->request->isGet()){
$data = Db::table('gc_banner')
->field('id,image')
->order('id desc')
->select();
$this->success('成功', $data);
}else{
... ... @@ -111,6 +113,7 @@ class Index extends Api
if($this->request->isGet()){
$data = Db::table('gc_gbanner')
->field('id,image')
->order('id desc')
->select();
$this->success('成功', $data);
}else{
... ...
... ... @@ -68,6 +68,7 @@ class Omessages extends Api
->where(['o.s_uid'=>$this->user_id,'p.status'=>$this->normal,'u.status'=>'normal'])
->page($page,$limit)
->field('o.id,o.order_sn,o.status,p.title,u.username,o.is_read')
->order('o.id desc')
->select();
$this->success('成功',$data);
}else{
... ...
... ... @@ -272,6 +272,7 @@ class Person extends Api
$data = Db::table('gc_bank')
->where(['uid'=>$this->user_id])
->field('id,bank_num,open_bank')
->order('id desc')
->select();
$this->success('成功', $data);
}else{
... ...
... ... @@ -91,6 +91,7 @@ class Porders extends Api
->where(['p.status'=>$this->normal,'u.status'=>'normal'])
->whereIn('p.id',$p_ids)
->field('p.id,p.title,p.price,p.images,u.username,u.mobile,u.address')
->order('p.id desc')
->select();
$total = 0;
foreach($data as $key=>$value){
... ... @@ -248,6 +249,7 @@ class Porders extends Api
->where($where)
->page($page,$limit)
->field('o.id,o.order_sn,o.status,p.title,o.unit_price,o.num,p.images,o.p_id')
->order('o.id desc')
->select();
$this->success('成功',$data);
}else{
... ...
... ... @@ -43,6 +43,7 @@ class Problems extends Api
if($this->request->isGet()){
$data = Db::table('gc_problem')
->field('id,title')
->order('id desc')
->select();
$this->success('成功',$data);
}else{
... ...
... ... @@ -61,6 +61,7 @@ class Smessages extends Api
->where(['a.uid'=>$this->user_id,'a.type'=>$withdrawal])
->page($page,$limit)
->field('m.id,m.title,m.type,m.is_read')
->order('m.id desc')
->select();
$this->success('成功',$data);
}else{
... ...
... ... @@ -122,6 +122,7 @@ class Teams extends Api
->where(['l.off_uid'=>$off_uid,'uid'=>$this->user_id,'u.status'=>'normal'])
->page($page,$limit)
->field('u.id uid,u.username,u.avatar,l.type,l.createtime,l.s_score score')
->order('l.id desc')
->select();
foreach($data as &$value){
$value['createtime'] = date('Y-m-d',$value['createtime']);
... ...