8000 Merge branch 'master' of https://gitee.com/laravel-admin/laraveladmin… · laraveladmin-cn/laraveladmin@12da7eb · GitHub
[go: up one dir, main page]

Skip to content

Commit 12da7eb

Browse files
committed
Merge branch 'master' of https://gitee.com/laravel-admin/laraveladmin into demo
2 parents 695771f + 4896544 commit 12da7eb

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

app/Http/Controllers/Traits/ResourceController.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@ public function whereValidate(&$validate_rules, $value, $key)
252252
public function list()
253253
{
254254
$this->selectValidate();
255+
$this->bindModel = $this->bindModel();
255256
//指定查询字段
256257
$fields = $this->selectFields($this->showIndexFields);
257258
//判断是否包含主键字段,没有包含自动添加
@@ -262,7 +263,7 @@ public function list()
262263
$has_primary_key = in_array($primary_key,$fields) || in_array($primary_key1,$fields);
263264
$fields = $has_primary_key ? $fields : array_merge([$primary_key1], $fields);
264265
}
265-
$fields and $this->bindModel = $this->bindModel()->select($fields);
266+
$fields and $this->bindModel->select($fields);
266267
//获取带有筛选条件的对象
267268
$obj = $this->getWithOptionModel();
268269
$obj = $this->handleList($obj);

resources/js/components/datatable.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -620,6 +620,10 @@
620620
axios.get(this.use_url+url,{params:options}).then( (response)=> {
621621
this.data.options.order = copyObj(options.order || {});
622622
if(url==this.data.configUrl['listUrl']){
623+
//判断是否是每页条数变更
624+
if(response.data.per_page!=this.data.list.per_page){
625+
response.data.last_page = Math.ceil(this.data.list.total/response.data.per_page);
626+
}
623627
for (let i in response.data ) {
624628
if(i == 'data' && this.options.dataPush && response.data.current_page>1){ //数据追加
625629
let data = response.data[i];

0 commit comments

Comments
 (0)
0