@@ -137,5 +137,19 @@ return array
'order' => array('id' => 'desc'),
'col' => 'id,uid,config_id,score|config_id',
),
+
+ # 更新积分
+ 'inc' => array
+ (
+ 'type' => 'update',
+ 'where' => array
+ 'id' => 'yes',
+ ),
+ 'set' => array
+ 'score' => array('yes', '+='),
)
);
@@ -321,7 +321,7 @@ class Core
$update = array();
$update['where_id'] = $user['id'];
- $update['score'] = $user['score'] + $num;
+ $update['score'] = $num;
$insert = $where;
$insert['action_log_id'] = $log['id'];
@@ -337,7 +337,7 @@ class Core
$insert['id'] = Dever::db($this->user_log)->insert($insert);
if ($insert['id']) {
- Dever::db($this->user)->update($update);
+ Dever::db($this->user)->inc($update);
# 提升等级
$level_type = Dever::db('score/level_type')->state();