Browse Source

fix php8 兼容性

magicblack 1 year ago
parent
commit
98f9a7f20e

+ 3 - 0
application/common/model/Actor.php

@@ -31,6 +31,9 @@ class Actor extends Base {
 
     public function listData($where,$order,$page=1,$limit=20,$start=0,$field='*',$addition=1,$totalshow=1)
     {
+        $page = $page > 0 ? (int)$page : 1;
+        $limit = $limit ? (int)$limit : 20;
+        $start = $start ? (int)$start : 0;
         if(!is_array($where)){
             $where = json_decode($where,true);
         }

+ 2 - 0
application/common/model/Admin.php

@@ -23,6 +23,8 @@ class Admin extends Base {
 
     public function listData($where,$order,$page,$limit=20)
     {
+        $page = $page > 0 ? (int)$page : 1;
+        $limit = $limit ? (int)$limit : 20;
         $total = $this->where($where)->count();
         $list = Db::name('Admin')->where($where)->order($order)->page($page)->limit($limit)->select();
         return ['code'=>1,'msg'=>lang('data_list'),'page'=>$page,'pagecount'=>ceil($total/$limit),'limit'=>$limit,'total'=>$total,'list'=>$list];

+ 3 - 0
application/common/model/Annex.php

@@ -23,6 +23,9 @@ class Annex extends Base {
 
     public function listData($where,$order,$page=1,$limit=20,$start=0,$field='*',$addition=1,$totalshow=1)
     {
+        $page = $page > 0 ? (int)$page : 1;
+        $limit = $limit ? (int)$limit : 20;
+        $start = $start ? (int)$start : 0;
         if(!is_array($where)){
             $where = json_decode($where,true);
         }

+ 6 - 0
application/common/model/Art.php

@@ -37,6 +37,9 @@ class Art extends Base {
 
     public function listData($where,$order,$page=1,$limit=20,$start=0,$field='*',$addition=1,$totalshow=1)
     {
+        $page = $page > 0 ? (int)$page : 1;
+        $limit = $limit ? (int)$limit : 20;
+        $start = $start ? (int)$start : 0;
         if(!is_array($where)){
             $where = json_decode($where,true);
         }
@@ -74,6 +77,9 @@ class Art extends Base {
 
     public function listRepeatData($where,$order,$page=1,$limit=20,$start=0,$field='*',$addition=1)
     {
+        $page = $page > 0 ? (int)$page : 1;
+        $limit = $limit ? (int)$limit : 20;
+        $start = $start ? (int)$start : 0;
         if(!is_array($where)){
             $where = json_decode($where,true);
         }

+ 2 - 0
application/common/model/Card.php

@@ -29,6 +29,8 @@ class Card extends Base {
 
     public function listData($where,$order,$page,$limit=20)
     {
+        $page = $page > 0 ? (int)$page : 1;
+        $limit = $limit ? (int)$limit : 20;
         $total = $this->where($where)->count();
         $list = Db::name('Card')->where($where)->order($order)->page($page)->limit($limit)->select();
         foreach($list as $k=>$v){

+ 3 - 0
application/common/model/Cash.php

@@ -18,6 +18,9 @@ class Cash extends Base {
 
     public function listData($where,$order,$page=1,$limit=20,$start=0)
     {
+        $page = $page > 0 ? (int)$page : 1;
+        $limit = $limit ? (int)$limit : 20;
+        $start = $start ? (int)$start : 0;
         if(!is_array($where)){
             $where = json_decode($where,true);
         }

+ 2 - 0
application/common/model/Cj.php

@@ -7,6 +7,8 @@ class Cj extends Base {
 
     public function listData($tab,$where,$order,$page,$limit=20)
     {
+        $page = $page > 0 ? (int)$page : 1;
+        $limit = $limit ? (int)$limit : 20;
         $total = Db::name($tab)->where($where)->count();
         $list = Db::name($tab)->where($where)->order($order)->page($page)->limit($limit)->select();
         return ['code'=>1,'msg'=>lang('data_list'),'page'=>$page,'pagecount'=>ceil($total/$limit),'limit'=>$limit,'total'=>$total,'list'=>$list];

+ 3 - 0
application/common/model/Collect.php

@@ -22,6 +22,9 @@ class Collect extends Base {
 
     public function listData($where,$order,$page=1,$limit=20,$start=0)
     {
+        $page = $page > 0 ? (int)$page : 1;
+        $limit = $limit ? (int)$limit : 20;
+        $start = $start ? (int)$start : 0;
         $total = $this->where($where)->count();
         $list = Db::name('Collect')->where($where)->order($order)->page($page)->limit($limit)->select();
         return ['code'=>1,'msg'=>lang('data_list'),'page'=>$page,'pagecount'=>ceil($total/$limit),'limit'=>$limit,'total'=>$total,'list'=>$list];

+ 3 - 0
application/common/model/Comment.php

@@ -29,6 +29,9 @@ class Comment extends Base {
 
     public function listData($where,$order,$page=1,$limit=20,$start=0,$field='*',$addition=1,$totalshow=1)
     {
+        $page = $page > 0 ? (int)$page : 1;
+        $limit = $limit ? (int)$limit : 20;
+        $start = $start ? (int)$start : 0;
         if(!is_array($where)){
             $where = json_decode($where,true);
         }

+ 3 - 0
application/common/model/Gbook.php

@@ -23,6 +23,9 @@ class Gbook extends Base {
 
     public function listData($where,$order,$page=1,$limit=20,$start=0)
     {
+        $page = $page > 0 ? (int)$page : 1;
+        $limit = $limit ? (int)$limit : 20;
+        $start = $start ? (int)$start : 0;
         if(!is_array($where)){
             $where = json_decode($where,true);
         }

+ 3 - 0
application/common/model/Link.php

@@ -18,6 +18,9 @@ class Link extends Base {
 
     public function listData($where,$order,$page=1,$limit=20,$start=0)
     {
+        $page = $page > 0 ? (int)$page : 1;
+        $limit = $limit ? (int)$limit : 20;
+        $start = $start ? (int)$start : 0;
         if(!is_array($where)){
             $where = json_decode($where,true);
         }

+ 3 - 0
application/common/model/Msg.php

@@ -31,6 +31,9 @@ class Msg extends Base {
 
     public function listData($where,$order,$page=1,$limit=20,$start=0,$field='*',$addition=1,$totalshow=1)
     {
+        $page = $page > 0 ? (int)$page : 1;
+        $limit = $limit ? (int)$limit : 20;
+        $start = $start ? (int)$start : 0;
         if(!is_array($where)){
             $where = json_decode($where,true);
         }

+ 3 - 0
application/common/model/Order.php

@@ -18,6 +18,9 @@ class Order extends Base {
 
     public function listData($where,$order,$page=1,$limit=20,$start=0)
     {
+        $page = $page > 0 ? (int)$page : 1;
+        $limit = $limit ? (int)$limit : 20;
+        $start = $start ? (int)$start : 0;
         if(!is_array($where)){
             $where = json_decode($where,true);
         }

+ 3 - 0
application/common/model/Plog.php

@@ -18,6 +18,9 @@ class Plog extends Base {
 
     public function listData($where,$order,$page=1,$limit=20,$start=0)
     {
+        $page = $page > 0 ? (int)$page : 1;
+        $limit = $limit ? (int)$limit : 20;
+        $start = $start ? (int)$start : 0;
         if(!is_array($where)){
             $where = json_decode($where,true);
         }

+ 3 - 0
application/common/model/Role.php

@@ -31,6 +31,9 @@ class Role extends Base {
 
     public function listData($where,$order,$page=1,$limit=20,$start=0,$field='*',$addition=1,$totalshow=1)
     {
+        $page = $page > 0 ? (int)$page : 1;
+        $limit = $limit ? (int)$limit : 20;
+        $start = $start ? (int)$start : 0;
         if(!is_array($where)){
             $where = json_decode($where,true);
         }

+ 3 - 0
application/common/model/Topic.php

@@ -32,6 +32,9 @@ class Topic extends Base {
 
     public function listData($where,$order,$page=1,$limit=20,$start=0,$field='*',$totalshow=1)
     {
+        $page = $page > 0 ? (int)$page : 1;
+        $limit = $limit ? (int)$limit : 20;
+        $start = $start ? (int)$start : 0;
         if(!is_array($where)){
             $where = json_decode($where,true);
         }

+ 2 - 0
application/common/model/Type.php

@@ -34,6 +34,8 @@ class Type extends Base {
 
     public function listData($where,$order,$format='def',$mid=0,$limit=999,$start=0,$totalshow=1)
     {
+        $limit = $limit ? (int)$limit : 20;
+        $start = $start ? (int)$start : 0;
         if(!is_array($where)){
             $where = json_decode($where,true);
         }

+ 3 - 0
application/common/model/Ulog.php

@@ -18,6 +18,9 @@ class Ulog extends Base {
 
     public function listData($where,$order,$page=1,$limit=20,$start=0)
     {
+        $page = $page > 0 ? (int)$page : 1;
+        $limit = $limit ? (int)$limit : 20;
+        $start = $start ? (int)$start : 0;
         if(!is_array($where)){
             $where = json_decode($where,true);
         }

+ 3 - 0
application/common/model/User.php

@@ -30,6 +30,9 @@ class User extends Base
 
     public function listData($where, $order, $page = 1, $limit = 20, $start = 0)
     {
+        $page = $page > 0 ? (int)$page : 1;
+        $limit = $limit ? (int)$limit : 20;
+        $start = $start ? (int)$start : 0;
         $total = $this->where($where)->count();
         $list = Db::name('User')->where($where)->order($order)->page($page)->limit($limit)->select();
         return ['code' => 1, 'msg' => lang('data_list'), 'page' => $page, 'pagecount' => ceil($total / $limit), 'limit' => $limit, 'total' => $total, 'list' => $list];

+ 3 - 0
application/common/model/Visit.php

@@ -23,6 +23,9 @@ class Visit extends Base {
 
     public function listData($where,$order,$page=1,$limit=20,$start=0,$field='*',$addition=1,$totalshow=1)
     {
+        $page = $page > 0 ? (int)$page : 1;
+        $limit = $limit ? (int)$limit : 20;
+        $start = $start ? (int)$start : 0;
         if(!is_array($where)){
             $where = json_decode($where,true);
         }

+ 3 - 0
application/common/model/Vod.php

@@ -71,6 +71,9 @@ class Vod extends Base {
 
     public function listRepeatData($where,$order,$page=1,$limit=20,$start=0,$field='*',$addition=1)
     {
+        $page = $page > 0 ? (int)$page : 1;
+        $limit = $limit ? (int)$limit : 20;
+        $start = $start ? (int)$start : 0;
         if(!is_array($where)){
             $where = json_decode($where,true);
         }

+ 6 - 0
application/common/model/Website.php

@@ -31,6 +31,9 @@ class Website extends Base {
 
     public function listData($where,$order,$page=1,$limit=20,$start=0,$field='*',$addition=1,$totalshow=1)
     {
+        $page = $page > 0 ? (int)$page : 1;
+        $limit = $limit ? (int)$limit : 20;
+        $start = $start ? (int)$start : 0;
         if(!is_array($where)){
             $where = json_decode($where,true);
         }
@@ -66,6 +69,9 @@ class Website extends Base {
 
     public function listRepeatData($where,$order,$page=1,$limit=20,$start=0,$field='*',$addition=1)
     {
+        $page = $page > 0 ? (int)$page : 1;
+        $limit = $limit ? (int)$limit : 20;
+        $start = $start ? (int)$start : 0;
         if(!is_array($where)){
             $where = json_decode($where,true);
         }