Merge pull request #87 from Yuanuo/patch-01

分享文件列表根据分享时间排序而不应该是ID。
pull/95/head
AaronLiu 7 years ago committed by GitHub
commit 5faea8f5ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -35,7 +35,7 @@ class Explore extends Controller{
$list = Db::name('shares') $list = Db::name('shares')
->where('type',"public") ->where('type',"public")
->where('origin_name',"like","%".$keyWords."%") ->where('origin_name',"like","%".$keyWords."%")
->order('id DESC') ->order('share_time DESC')
->paginate(10); ->paginate(10);
$listData = $list->all(); $listData = $list->all();
foreach ($listData as $key => $value) { foreach ($listData as $key => $value) {

@ -35,7 +35,7 @@ class Profile extends Controller{
$list = Db::name('shares') $list = Db::name('shares')
->where('owner',$userId) ->where('owner',$userId)
->where('type',"public") ->where('type',"public")
->order('id DESC') ->order('share_time DESC')
->paginate(10); ->paginate(10);
break; break;
case 'hot': case 'hot':
@ -49,7 +49,7 @@ class Profile extends Controller{
$list = Db::name('shares') $list = Db::name('shares')
->where('owner',$userId) ->where('owner',$userId)
->where('type',"public") ->where('type',"public")
->order('id DESC') ->order('share_time DESC')
->paginate(10); ->paginate(10);
break; break;
} }

@ -178,7 +178,7 @@ class Share extends Controller{
} }
$userInfo = $this->userObj->getInfo(); $userInfo = $this->userObj->getInfo();
$groupData = $this->userObj->getGroupData(); $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(); $listData = $list->all();
foreach ($listData as $key => $value) { foreach ($listData as $key => $value) {
if($value["source_type"]=="file"){ if($value["source_type"]=="file"){

@ -519,7 +519,7 @@ class AdminHandler extends Model{
public function listShare(){ public function listShare(){
$pageSize = !cookie('?pageSize') ? 10 : cookie('pageSize'); $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") $this->pageData = Db::name("shares")
->where(function ($query) { ->where(function ($query) {
if(!empty(cookie('shareSearch'))){ if(!empty(cookie('shareSearch'))){

Loading…
Cancel
Save