|
@@ -522,17 +522,19 @@ final class EasyORM {
|
|
|
$incrFields = array();
|
|
|
$privateKeys = $this->getPrivateKey();
|
|
|
foreach ($value as $key => $step) {
|
|
|
- if($step <= 0) continue;
|
|
|
//去掉private的值
|
|
|
if(in_array($key, $privateKeys)) continue;
|
|
|
+ if($step == 0) continue;
|
|
|
+ if($step < 0) {
|
|
|
+ $incrFields[$key .":minus"] = $step * -1;
|
|
|
+ continue;
|
|
|
+ }
|
|
|
$incrFields[$key .':plus'] = $step;
|
|
|
}
|
|
|
if(count($incrFields) == 0){
|
|
|
return Response::FailUpdate('_incr', array('_result' => '未指定incr的步长'));
|
|
|
}
|
|
|
-
|
|
|
$fieldsAndValues = $this->getWhereCondition();
|
|
|
-
|
|
|
$result = $this->_easyORM->db
|
|
|
->set($incrFields)
|
|
|
->where($fieldsAndValues)
|