Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions ThinkPHP/Lib/Core/Db.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,16 @@ protected function parseLock($lock=false) {
protected function parseSet($data) {
foreach ($data as $key=>$val){
$value = $this->parseValue($val);
if(is_scalar($value)) // 过滤非标量数据
$set[] = $this->parseKey($key).'='.$value;

if($val['field']!=""){
//增加updatte set 字段1=字段2需求
//data['xx']=array("field"=>'yy');
$tt=$val['field'];
$set[] = $this->parseKey($key).'='.$tt;
}else{
if(is_scalar($value)) // 过滤非标量数据
$set[] = $this->parseKey($key).'='.$value;
}
}
return ' SET '.implode(',',$set);
}
Expand Down Expand Up @@ -1029,4 +1037,4 @@ public function __destruct() {

// 关闭数据库 由驱动类定义
public function close(){}
}
}