瀏覽代碼

add to local

stanley-king 8 年之前
父節點
當前提交
6a85369655
共有 2 個文件被更改,包括 21 次插入12 次删除
  1. 21 9
      core/framework/libraries/model.php
  2. 0 3
      core/framework/libraries/queue.php

+ 21 - 9
core/framework/libraries/model.php

@@ -3,9 +3,8 @@
  * 核心文件
  *
  * 模型类
- *
- * @package    core* www.abc.com 专业团队 提供售后服务
  */
+
 class Model
 {
 	protected $name = '';
@@ -112,7 +111,9 @@ class Model
             	}
             }
             return $this;
-        }elseif(in_array(strtolower($method),array('page'),true)){
+        }
+        elseif(in_array(strtolower($method),array('page'),true))
+        {
             if ($args[0] == null){
 				return $this;
 			}elseif(!is_numeric($args[0]) || $args[0] <= 0){
@@ -136,10 +137,14 @@ class Model
 			$this->unoptions = false;
 			pagecmd('setTotalNum',	$this->get_field('COUNT(*) AS nc_count'));
         	return $this;
-        }elseif(in_array(strtolower($method),array('min','max','count','sum','avg'),true)){
+        }
+        elseif(in_array(strtolower($method),array('min','max','count','sum','avg'),true))
+        {
             $field =  isset($args[0])?$args[0]:'*';
             return $this->get_field(strtoupper($method).'('.$field.') AS nc_'.$method);
-        }elseif(strtolower($method)=='count1'){
+        }
+        elseif(strtolower($method)=='count1')
+        {
             $field =  isset($args[0])?$args[0]:'*';
             $options['field'] = ('count('.$field.') AS nc_count');
             $options =  $this->parse_options($options);
@@ -148,11 +153,15 @@ class Model
             if(!empty($result)) {
                 return reset($result[0]);
             }
-        }elseif(strtolower(substr($method,0,6))=='getby_') {
+        }
+        elseif(strtolower(substr($method,0,6))=='getby_')
+        {
             $field   =   substr($method,6);
             $where[$field] =  $args[0];
             return $this->where($where)->find();
-        }elseif(strtolower(substr($method,0,7))=='getfby_') {
+        }
+        elseif(strtolower(substr($method,0,7))=='getfby_')
+        {
             $name   =   substr($method,7);
             $where[$name] =$args[0];
             //getfby_方法只返回第一个字段值
@@ -160,7 +169,9 @@ class Model
             	$args[1] = substr($args[1],0,strpos($args[1],','));
             }
             return $this->where($where)->get_field($args[1]);
-        }else{
+        }
+        else
+        {
             $error = 'Model Error:  Function '.$method.' is not exists!';
             throw_exception($error);
             return;
@@ -201,7 +212,8 @@ class Model
         if(empty($resultSet)) {
             return array();
         }
-        if ($options['key'] != '' && is_array($resultSet)){
+        if ($options['key'] != '' && is_array($resultSet))
+        {
         	$tmp = array();
         	foreach ($resultSet as $value) {
         		$tmp[$value[$options['key']]] = $value;

+ 0 - 3
core/framework/libraries/queue.php

@@ -58,9 +58,6 @@ class QueueDB {
     //存定义存储表的数量,系统会随机分配存储
     private $_tb_num = 2;
 
-    //临时存储表
-    private $_tb_tmp = 'TMP_TABLE';
-
     /**
      * 初始化
      */