mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-11-05 09:20:40 +00:00
排序问题优化
This commit is contained in:
parent
3425e2bff8
commit
c4a21a16e0
@ -59,7 +59,7 @@ class ArticleCategoryDao extends BaseDao
|
||||
public function getArticleCategory()
|
||||
{
|
||||
return $this->search(['hidden' => 0, 'is_del' => 0, 'status' => 1, 'pid' => 0])->with(['children'])
|
||||
->order('sort DESC')
|
||||
->order('sort DESC,id DESC')
|
||||
->field('id,pid,title')
|
||||
->select()->toArray();
|
||||
}
|
||||
@ -77,7 +77,7 @@ class ArticleCategoryDao extends BaseDao
|
||||
->where('hidden', 0)
|
||||
->where('is_del', 0)
|
||||
->where('status', 1)
|
||||
->order('sort DESC')
|
||||
->order('sort DESC,id DESC')
|
||||
->field('id,pid,title')
|
||||
->select()->toArray();
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ class PageCategoryDao extends BaseDao
|
||||
{
|
||||
return $this->search($where)->field($field)->when($page && $limit, function ($query) use ($page, $limit) {
|
||||
$query->page();
|
||||
})->order('sort desc')->select()->toArray();
|
||||
})->order('sort desc,id DESC')->select()->toArray();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -702,7 +702,7 @@ class StoreOrderDao extends BaseDao
|
||||
$query->field("sum($sumField) as number,FROM_UNIXTIME($group, '$timeUinx') as time");
|
||||
$query->group("FROM_UNIXTIME($group, '$timeUinx')");
|
||||
})
|
||||
->order('pay_time ASC')->select()->toArray();
|
||||
->order('pay_time ASC,id DESC')->select()->toArray();
|
||||
}
|
||||
|
||||
/**时间分组订单数统计
|
||||
@ -730,7 +730,7 @@ class StoreOrderDao extends BaseDao
|
||||
$query->field("count($sumField) as number,FROM_UNIXTIME(pay_time, '$timeUinx') as time");
|
||||
$query->group("FROM_UNIXTIME(pay_time, '$timeUinx')");
|
||||
})
|
||||
->order('pay_time ASC')->select()->toArray();
|
||||
->order('pay_time ASC,id DESC')->select()->toArray();
|
||||
}
|
||||
|
||||
/**时间段支付订单人数
|
||||
@ -773,7 +773,7 @@ class StoreOrderDao extends BaseDao
|
||||
$query->field("count(distinct uid) as number,FROM_UNIXTIME(pay_time, '$timeUinx') as time");
|
||||
$query->group("FROM_UNIXTIME(pay_time, '$timeUinx')");
|
||||
})
|
||||
->order('pay_time ASC')->select()->toArray();
|
||||
->order('pay_time ASC,id DESC')->select()->toArray();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ class ShippingTemplatesDao extends BaseDao
|
||||
*/
|
||||
public function getShippingList(array $where, int $page, int $limit)
|
||||
{
|
||||
return $this->search($where)->order('sort DESC')->page($page, $limit)->select()->toArray();
|
||||
return $this->search($where)->order('sort DESC,id DESC')->page($page, $limit)->select()->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -128,7 +128,7 @@ class SystemMenusDao extends BaseDao
|
||||
public function menusSelect(array $where, $type = 1)
|
||||
{
|
||||
if ($type == 1) {
|
||||
return $this->search($where)->field('id,pid,menu_name,menu_path,unique_auth,sort')->order('sort DESC')->select();
|
||||
return $this->search($where)->field('id,pid,menu_name,menu_path,unique_auth,sort')->order('sort DESC,id DESC')->select();
|
||||
} else {
|
||||
return $this->search($where)->group('pid')->column('pid');
|
||||
}
|
||||
@ -143,7 +143,7 @@ class SystemMenusDao extends BaseDao
|
||||
public function getSearchList()
|
||||
{
|
||||
return $this->search(['is_show' => 1, 'auth_type' => 1, 'is_del' => 0, 'is_show_path' => 0])
|
||||
->field('id,pid,menu_name,menu_path,unique_auth,sort')->order('sort DESC')->select();
|
||||
->field('id,pid,menu_name,menu_path,unique_auth,sort')->order('sort DESC,id DESC')->select();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -84,7 +84,7 @@ class SystemConfigDao extends BaseDao
|
||||
{
|
||||
$where['tab_id'] = $tabId;
|
||||
if ($status == 1) $where['status'] = $status;
|
||||
return $this->search($where)->order('sort desc')->select()->toArray();
|
||||
return $this->search($where)->order('sort desc,id DESC')->select()->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -50,7 +50,7 @@ class MemberShipDao extends BaseDao
|
||||
*/
|
||||
public function getApiList(array $where)
|
||||
{
|
||||
return $this->search()->where($where)->order('sort desc')->select()->toArray();
|
||||
return $this->search()->where($where)->order('sort desc,id DESC')->select()->toArray();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -44,6 +44,6 @@ class UserAddressDao extends BaseDao
|
||||
*/
|
||||
public function getList(array $where, string $field = '*', int $page, int $limit): array
|
||||
{
|
||||
return $this->search($where)->field($field)->page($page, $limit)->order('is_default DESC')->select()->toArray();
|
||||
return $this->search($where)->field($field)->page($page, $limit)->order('is_default DESC,id DESC')->select()->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
@ -45,7 +45,7 @@ class UserLabelCateDao extends BaseDao
|
||||
{
|
||||
return $this->search($where)->when($page && $limit, function ($query) use ($page, $limit) {
|
||||
$query->page($page, $limit);
|
||||
})->order('sort DESC')->select()->toArray();
|
||||
})->order('sort DESC,id DESC')->select()->toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -59,6 +59,6 @@ class UserLabelCateDao extends BaseDao
|
||||
{
|
||||
return $this->getModel()->when(count($with), function ($query) use ($with) {
|
||||
$query->with($with);
|
||||
})->order('sort DESC')->select()->toArray();
|
||||
})->order('sort DESC,id DESC')->select()->toArray();
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user