1
This commit is contained in:
@@ -17,9 +17,9 @@ class PostController extends BaseController
|
|||||||
{
|
{
|
||||||
use CrudControllerTrait;
|
use CrudControllerTrait;
|
||||||
|
|
||||||
protected $noNeedLogin = ['index'];
|
// protected $noNeedLogin = ['index'];
|
||||||
|
//
|
||||||
protected $noNeedHeaderData = ['index'];
|
// protected $noNeedHeaderData = ['index'];
|
||||||
|
|
||||||
protected $service;
|
protected $service;
|
||||||
|
|
||||||
|
|||||||
@@ -52,7 +52,11 @@ class PostService
|
|||||||
$config['where']['category_id'] = $p['category_id'];
|
$config['where']['category_id'] = $p['category_id'];
|
||||||
}
|
}
|
||||||
if (isset($p['scene']) && $p['scene']=='self') {
|
if (isset($p['scene']) && $p['scene']=='self') {
|
||||||
$config['where']['user_id'] = $request->user->uid;
|
if(!empty($request->user) && !empty($request->user->uid)){
|
||||||
|
$config['where']['user_id'] = $request->user->uid;
|
||||||
|
}else{
|
||||||
|
$config['where']['user_id'] = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(isset($p['year']) && $p['year']){
|
if(isset($p['year']) && $p['year']){
|
||||||
$from = strtotime($p['year'].'-01-01');
|
$from = strtotime($p['year'].'-01-01');
|
||||||
|
|||||||
Reference in New Issue
Block a user