diff --git a/app/admin/logic/content/ResourceLogic.php b/app/admin/logic/content/ResourceLogic.php index b2a41b0..8b9db9c 100644 --- a/app/admin/logic/content/ResourceLogic.php +++ b/app/admin/logic/content/ResourceLogic.php @@ -98,7 +98,7 @@ class ResourceLogic extends Logic try { Resource::create([ 'cid' => $post['cid'], - 'cid2' => $post['cid2'], + 'cid2' => $post['cid2'] ?? 0 , 'title' => $post['title'], 'image' => $post['image'] ?? '', 'path' => $post['path'] ?? '', @@ -113,7 +113,8 @@ class ResourceLogic extends Logic 'likes' => 0, 'download' => 0, 'sort' => $post['sort'] ?? 0, - 'is_show' => $post['is_show'] + 'is_show' => $post['is_show'], + 'base_visit' => $post['base_visit']?? rand(500,1000), ]); return true; @@ -134,7 +135,7 @@ class ResourceLogic extends Logic try { Resource::update([ 'cid' => $post['cid'], - 'cid2' => $post['cid2'], + 'cid2' => $post['cid2'] ?? 0 , 'title' => $post['title'], 'image' => $post['image'] ?? '', 'path' => $post['path'] ?? '', @@ -149,7 +150,8 @@ class ResourceLogic extends Logic 'likes' => 0, 'download' => 0, 'sort' => $post['sort'] ?? 0, - 'is_show' => $post['is_show'] + 'is_show' => $post['is_show'], + 'base_visit' => $post['base_visit']?? rand(500,1000), ], ['id'=>$post['id']]); return true; diff --git a/app/admin/logic/user/ShipLogLogic.php b/app/admin/logic/user/ShipLogLogic.php index ea080a9..9749582 100644 --- a/app/admin/logic/user/ShipLogLogic.php +++ b/app/admin/logic/user/ShipLogLogic.php @@ -8,6 +8,7 @@ use app\common\model\order\OrderUser; use app\common\model\user\UserShip; use app\common\model\user\UserTag; use app\common\model\user\User; +use app\common\server\UrlServer; class ShipLogLogic extends Logic { @@ -61,12 +62,13 @@ class ShipLogLogic extends Logic ->alias('a') ->join('user b','a.user_id=b.id','LEFT') ->join('user_ship c','a.org_id=c.id','LEFT') - ->page($get['page'], $get['limit'])->select()->toArray(); + ->page($get['page'], $get['limit'])->order('id','desc')->select()->toArray(); $count = $orderuser ->alias('a')->alias('a') ->join('user b','a.user_id=b.id','LEFT')->where($where)->count(); foreach ($lists as &$item){ + $item['avatar'] = $item['avatar'] ? UrlServer::getFileUrl($item['avatar']) : ''; $item['pay_time_str'] = date("Y-m-d H:i:s",$item['pay_time']); $item['type_name'] = $item['type']==0?'免费':'付费'; $item['order_source_name'] = $order_source[$item['order_source']]; diff --git a/app/admin/view/content/resource/add.html b/app/admin/view/content/resource/add.html index b0e14c0..32ca91e 100644 --- a/app/admin/view/content/resource/add.html +++ b/app/admin/view/content/resource/add.html @@ -86,7 +86,7 @@