|
@@ -332,7 +332,7 @@ class special_object
|
|
|
|
|
|
$data['special_id'] = $sp_id;
|
|
|
$data['item_sort'] = $item_sort;
|
|
|
- $item_id = $this->save_item($item->item_id(),$data);
|
|
|
+ $item_id = $this->save_item($data);
|
|
|
if($item_id != false && $item->is_vote())
|
|
|
{
|
|
|
$vote_result = $item->vote_result();
|
|
@@ -377,17 +377,11 @@ class special_object
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private function save_item($item_id,$data)
|
|
|
+ private function save_item($data)
|
|
|
{
|
|
|
- if($item_id > 0) {
|
|
|
- $result = $this->mb_special->editUserSpecialItem($data,$item_id);
|
|
|
- return ($result == false ? false : $item_id);
|
|
|
- }
|
|
|
- else {
|
|
|
- $result = $this->mb_special->addUserSpecialItem($data);
|
|
|
- if($result == false) return false;
|
|
|
- return $result['item_id'];
|
|
|
- }
|
|
|
+ $result = $this->mb_special->addUserSpecialItem($data);
|
|
|
+ if($result == false) return false;
|
|
|
+ return $result['item_id'];
|
|
|
}
|
|
|
|
|
|
public function insert_divider($special_id,$item_sort)
|
|
@@ -400,6 +394,6 @@ class special_object
|
|
|
$param['has_margin'] = 0;
|
|
|
$param['bg_image'] = '';
|
|
|
|
|
|
- return $this->save_item(0,$param);
|
|
|
+ return $this->save_item($param);
|
|
|
}
|
|
|
}
|