mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-10-31 15:00:52 +00:00
修改生成代码模型主键错误问题
This commit is contained in:
parent
269b100715
commit
fa15a01ac2
@ -36,8 +36,9 @@ class {%nameCamel%} extends BaseModel
|
||||
protected $name = '{%name%}';
|
||||
|
||||
/**
|
||||
* 主键
|
||||
* @var string
|
||||
*/
|
||||
protected $key = '{%key%}';
|
||||
protected $pk = '{%key%}';
|
||||
|
||||
}
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
public function getCrudListIndex(array $where = [])
|
||||
{
|
||||
[$page, $limit] = $this->getPageValue();
|
||||
$model = $this->dao->selectModel($where, '*', $page ?: 1, $limit ?: 10, '{%key%} desc');
|
||||
$model = $this->dao->selectModel($where, '*', 0, 0, '{%key%} desc');
|
||||
|
||||
return ['count' => $model->count(), 'list' => $model->select()->toArray()];
|
||||
return ['count' => $model->count(), 'list' => $model->page($page ?: 1, $limit ?: 10)->select()->toArray()];
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user