解决linux下文件名大小写的bug、完善用户中心
This commit is contained in:
@@ -8,17 +8,54 @@
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\controller\user;
|
||||
|
||||
use think\facade\Db;
|
||||
use app\model\Model;
|
||||
use app\model\Attribute;
|
||||
|
||||
/**
|
||||
* @title 内容模块
|
||||
*/
|
||||
class Content extends Base {
|
||||
|
||||
public $modelInfo = [];
|
||||
public $model = null;
|
||||
|
||||
public function initialize() {
|
||||
parent::initialize();
|
||||
$this->modelInfo = Model::where('name', $this->request->param('name'))->find()->append(['grid_list', 'attr_group'])->toArray();
|
||||
$this->model = Db::name($this->modelInfo['name']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @title 内容首页
|
||||
* @return [type] [description]
|
||||
*/
|
||||
public function index() {
|
||||
return $this->fetch();
|
||||
if ($this->modelInfo['list_grid'] == '') {
|
||||
return $this->error("列表定义不正确!", url('/user/model/edit', array('id' => $this->modelInfo['id'])));
|
||||
}
|
||||
$order = "id desc";
|
||||
$map = [];
|
||||
$map[] = ['uid', '=', session('userInfo.uid')];
|
||||
|
||||
$list = $this->model->where($map)->order($order)->paginate($this->modelInfo['list_row'], false, array(
|
||||
'query' => $this->request->param(),
|
||||
));
|
||||
|
||||
$this->data = array(
|
||||
'grid' => $this->modelInfo['grid_list'],
|
||||
'list' => $list,
|
||||
'page' => $list->render(),
|
||||
'model_name' => $this->modelInfo['name'],
|
||||
'model_id' => $this->modelInfo['id'],
|
||||
'meta_title' => $this->modelInfo['title'].'列表'
|
||||
);
|
||||
if ($this->modelInfo['template_list']) {
|
||||
$template = 'user@content/' . $this->modelInfo['template_list'];
|
||||
} else {
|
||||
$template = 'user@content/index';
|
||||
}
|
||||
return $this->fetch($template);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user