Przeglądaj źródła

modify for page

root 9 lat temu
rodzic
commit
5bef440a61

+ 10 - 9
core/framework/function/core.php

@@ -62,7 +62,7 @@ function checkSeccode($nchash,$value){
 }
 
 /**
- * 设置cookie QQ wap 登录 by 33h ao.co m 
+ * 设置cookie QQ wap 登录 by 33h ao.co m
  *
  * @param string $name cookie 的名称
  * @param string $value cookie 的值
@@ -437,7 +437,7 @@ function Model($model = null, $base_path = null)
 	if (!is_null($model) && isset($_cache[$cache_key])) {
         return $_cache[$cache_key];
     }
-    
+
 	$base_path = $base_path == null ? BASE_DATA_PATH : $base_path;
 	$file_name = $base_path.'/model/'.$model.'.model.php';
 	$class_name = $model.'Model';
@@ -1218,13 +1218,13 @@ function import($libname,$file_ext='.php'){
 		$path = str_replace('#','.',$path);
 	}
 	//返回安全路径
-    
+
 	if(preg_match('/^[\w\d\/_.]+$/i', $path)){
-		$file = realpath($base_dir.$path.$file_ext);        
+		$file = realpath($base_dir.$path.$file_ext);
 	}else{
 		$file = false;
 	}
-    
+
 	if (!$file){
 		exit($path.$file_ext.' isn\'t exists!');
 	}else{
@@ -1472,6 +1472,7 @@ function pagecmd($cmd ='', $arg = ''){
 		case 'seteachnum':		$page->setEachNum($arg);break;
 		case 'settotalnum': 	$page->setTotalNum($arg);break;
 		case 'setnowpage': 	    $page->setNowPage($arg);break;
+		case 'settotalpage': 	$page->setTotalPage();break;
 		case 'setstyle': 		$page->setStyle($arg);break;
 		case 'show': 			return $page->show($arg);break;
 		case 'obj':				return $page;break;
@@ -1689,8 +1690,8 @@ function rcache($key = null, $prefix = '', $fields = '*')
     if ($cache_info === false) {
         //取单个字段且未被缓存
         $data  = array();
-    } 
-    elseif (is_array($cache_info)) 
+    }
+    elseif (is_array($cache_info))
     {
         //如果有一个键值为false(即未缓存),则整个函数返回空,让系统重新生成全部缓存
         $data = $cache_info;
@@ -1701,7 +1702,7 @@ function rcache($key = null, $prefix = '', $fields = '*')
                 break;
             }
         }
-    } 
+    }
     else
     {
         //string 取单个字段且被缓存
@@ -1749,7 +1750,7 @@ function dcache($key = null, $prefix = '')
     if ($key===null || !C('cache_open')) {
     	return true;
     }
-    
+
     $ins = Cache::getInstance('cacheredis');
     return $ins->hdel($key, $prefix);
 }

+ 1 - 1
data/config/config.ini.php

@@ -12,7 +12,7 @@ const boss_host = 'http://172.40.2.14';
 
 const jeff_office = 'http://192.168.1.128';
 const liax_office = 'http://192.168.1.136';
-$SRV_HOST = test_srv_host;
+$SRV_HOST = liax_office;
 
 $config['base_site_url']        = $SRV_HOST;
 $config['shop_site_url'] 		= $SRV_HOST.'/shop';

+ 4 - 0
mobile/control/goods.php

@@ -28,7 +28,11 @@ class goodsControl extends mobileHomeControl
         $model_search = Model('search');
 
         if (!empty($_GET['curpage'])) {
+            pagecmd('seteachnum',$_GET['page']);
             pagecmd('setnowpage', $_GET['curpage']);
+
+            pagecmd('settotalnum',1);
+            pagecmd('settotalpage');
         }
 
         //查询条件