|
@@ -8,6 +8,8 @@
|
|
|
|
|
|
*/
|
|
|
defined('InShopNC') or exit('Access Invalid!');
|
|
|
+require_once (BASE_ROOT_PATH . '/helper/message/publisher.php');
|
|
|
+
|
|
|
|
|
|
class p_bundlingModel extends Model {
|
|
|
const STATE1 = 1; // 开启
|
|
@@ -70,7 +72,11 @@ class p_bundlingModel extends Model {
|
|
|
* @return boolean
|
|
|
*/
|
|
|
public function addBundling($insert, $replace = false) {
|
|
|
- return $this->table('p_bundling')->insert($insert, $replace);
|
|
|
+ $ret = $this->table('p_bundling')->insert($insert, $replace);
|
|
|
+ if($ret != false) {
|
|
|
+ $this->publis_message();
|
|
|
+ }
|
|
|
+ return $ret;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -81,7 +87,11 @@ class p_bundlingModel extends Model {
|
|
|
* @return boolean
|
|
|
*/
|
|
|
public function editBundling($update, $condition) {
|
|
|
- return $this->table('p_bundling')->where($condition)->update($update);
|
|
|
+ $ret = $this->table('p_bundling')->where($condition)->update($update);
|
|
|
+ if($ret != false) {
|
|
|
+ $this->publis_message();
|
|
|
+ }
|
|
|
+ return $ret;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -98,8 +108,13 @@ class p_bundlingModel extends Model {
|
|
|
foreach ($bundlinggoods_list as $val) {
|
|
|
$blid_array[] = $val['bl_id'];
|
|
|
}
|
|
|
+
|
|
|
$update = array('bl_state' => self::STATE0);
|
|
|
- return $this->table('p_bundling')->where(array('bl_id' => array('in', $blid_array)))->update($update);
|
|
|
+ $ret = $this->table('p_bundling')->where(array('bl_id' => array('in', $blid_array)))->update($update);
|
|
|
+ if($ret != false) {
|
|
|
+ $this->publis_message();
|
|
|
+ }
|
|
|
+ return $ret;
|
|
|
}
|
|
|
return true;
|
|
|
}
|
|
@@ -310,10 +325,12 @@ class p_bundlingModel extends Model {
|
|
|
return true;
|
|
|
}
|
|
|
$result = $this->table('p_bundling_goods')->where($condition)->delete();
|
|
|
- if ($result) {
|
|
|
+ if ($result)
|
|
|
+ {
|
|
|
foreach ($list as $v) {
|
|
|
$this->_dGoodsBundlingCache($v['goods_id']);
|
|
|
}
|
|
|
+ $this->publis_message();
|
|
|
}
|
|
|
return $result;
|
|
|
}
|
|
@@ -403,4 +420,10 @@ class p_bundlingModel extends Model {
|
|
|
private function _dGoodsBundlingCache($goods_id) {
|
|
|
return dcache($goods_id, 'goods_bundling');
|
|
|
}
|
|
|
+
|
|
|
+ private function publis_message()
|
|
|
+ {
|
|
|
+ $publisher = new message\publisher();
|
|
|
+ $publisher->modify_activity_bundling();
|
|
|
+ }
|
|
|
}
|