作者 liyuhang

gx

@@ -107,15 +107,11 @@ class Base extends Model @@ -107,15 +107,11 @@ class Base extends Model
107 */ 107 */
108 public function read($condition,$files = ['*']) 108 public function read($condition,$files = ['*'])
109 { 109 {
110 - $info = Common::get_user_cache($this->getTable(),$condition['id']);  
111 - if(empty($info)){  
112 $query = $this->formatQuery($condition); 110 $query = $this->formatQuery($condition);
113 $info = $query->select($files)->first(); 111 $info = $query->select($files)->first();
114 if (empty($info)) { 112 if (empty($info)) {
115 return false; 113 return false;
116 } 114 }
117 - Common::set_user_cache($info,$this->getTable(),$condition['id']);  
118 - }  
119 $info = $info->toArray(); 115 $info = $info->toArray();
120 return $info; 116 return $info;
121 } 117 }
@@ -140,10 +136,6 @@ class Base extends Model @@ -140,10 +136,6 @@ class Base extends Model
140 $query = $this->formatQuery($condition); 136 $query = $this->formatQuery($condition);
141 $data['updated_at'] = date('Y-m-d H:i:s'); 137 $data['updated_at'] = date('Y-m-d H:i:s');
142 $rs = $query->update($data); 138 $rs = $query->update($data);
143 - if($rs !== false){  
144 - //删除缓存  
145 - Common::del_user_cache($this->getTable(),$condition['id']);  
146 - }  
147 return $rs; 139 return $rs;
148 } 140 }
149 /** 141 /**
@@ -155,10 +147,6 @@ class Base extends Model @@ -155,10 +147,6 @@ class Base extends Model
155 public function del($condition){ 147 public function del($condition){
156 $query = $this->formatQuery($condition); 148 $query = $this->formatQuery($condition);
157 $rs = $query->delete(); 149 $rs = $query->delete();
158 - if($rs !== false){  
159 - //删除缓存  
160 - Common::del_user_cache($this->getTable(),$condition['id']);  
161 - }  
162 return $rs; 150 return $rs;
163 } 151 }
164 /** 152 /**