提交 d5f5cbc0 编写于 作者: Y Yuanuo

分享文件列表根据分享时间排序而不应该是ID。

显示分享文件列表时根据分享时间倒序排列,最新分享的文件显示在最前,因为分享顺序并不一定按照文件上传顺序决定。
上级 a1a9f7cd
......@@ -35,7 +35,7 @@ class Explore extends Controller{
$list = Db::name('shares')
->where('type',"public")
->where('origin_name',"like","%".$keyWords."%")
->order('id DESC')
->order('share_time DESC')
->paginate(10);
$listData = $list->all();
foreach ($listData as $key => $value) {
......
......@@ -35,7 +35,7 @@ class Profile extends Controller{
$list = Db::name('shares')
->where('owner',$userId)
->where('type',"public")
->order('id DESC')
->order('share_time DESC')
->paginate(10);
break;
case 'hot':
......@@ -49,7 +49,7 @@ class Profile extends Controller{
$list = Db::name('shares')
->where('owner',$userId)
->where('type',"public")
->order('id DESC')
->order('share_time DESC')
->paginate(10);
break;
}
......
......@@ -178,7 +178,7 @@ class Share extends Controller{
}
$userInfo = $this->userObj->getInfo();
$groupData = $this->userObj->getGroupData();
$list = Db::name('shares')->where('owner',$this->userObj->uid)->paginate(10);
$list = Db::name('shares')->where('owner',$this->userObj->uid)->order('share_time DESC')->paginate(30);
$listData = $list->all();
foreach ($listData as $key => $value) {
if($value["source_type"]=="file"){
......
......@@ -519,7 +519,7 @@ class AdminHandler extends Model{
public function listShare(){
$pageSize = !cookie('?pageSize') ? 10 : cookie('pageSize');
$orderType = empty(cookie('orderMethodShare')) ? "id DESC" : cookie('orderMethodShare');
$orderType = empty(cookie('orderMethodShare')) ? "share_time DESC" : cookie('orderMethodShare');
$this->pageData = Db::name("shares")
->where(function ($query) {
if(!empty(cookie('shareSearch'))){
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册