|
@@ -197,10 +197,11 @@ class admin_operControl extends mbMemberControl
|
|
|
public function reset_bonus_snOp()
|
|
|
{
|
|
|
$bonus_type = Model('bonus_type');
|
|
|
- $types = $bonus_type->field('type_id')->where(array('type_id' => array('gt',0)))->limit(false)->select();
|
|
|
+ $types = $bonus_type->field('type_id,type_sn')->where(array('type_id' => array('gt',0)))->limit(false)->select();
|
|
|
foreach ($types as $type)
|
|
|
{
|
|
|
$type_id = intval($type['type_id']);
|
|
|
+ $type_sn = $type['type_sn'];
|
|
|
$user_bonus = Model('user_bonus');
|
|
|
|
|
|
$bonuses = $user_bonus->field('bonus_id,bonus_sn')->where(array('type_id' => $type_id))->limit(false)->select();
|
|
@@ -218,7 +219,7 @@ class admin_operControl extends mbMemberControl
|
|
|
}
|
|
|
$pos = 0;
|
|
|
foreach ($bonuses as $bonus) {
|
|
|
- $bonus_sn = $bonus['bonus_sn'] . sprintf($format,$pos);
|
|
|
+ $bonus_sn = $type_sn . sprintf($format,$pos);
|
|
|
$user_bonus->where(array('bonus_id' => intval($bonus['bonus_id'])))->update(array('bonus_sn' => $bonus_sn));
|
|
|
if($user_bonus->affected_rows() <= 0) {
|
|
|
Log::record("update bonus_sn error",Log::ERR);
|