queue.logic.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671
  1. <?php
  2. /**
  3. * 队列
  4. *
  5. * 方法名需要和 QueueClient::push中第一个参数一致,如:
  6. * QueueClient::push('editGroupbuySaleCount',$groupbuy_info);
  7. * public function editGroupbuySaleCount($groupbuy_info){...}
  8. *
  9. */
  10. defined('InShopNC') or exit('Access Invalid!');
  11. require_once (BASE_ROOT_PATH . '/helper/push_sender.php');
  12. require_once (BASE_ROOT_PATH . '/helper/sms_helper.php');
  13. require_once (BASE_ROOT_PATH . '/helper/kdn_helper.php');
  14. require_once (BASE_ROOT_PATH . '/helper/statistics_helper.php');
  15. require_once (BASE_ROOT_PATH . '/helper/member_helper.php');
  16. require_once (BASE_ROOT_PATH . '/helper/account_helper.php');
  17. require_once (BASE_ROOT_PATH . '/helper/fcode/generator.php');
  18. require_once (BASE_ROOT_PATH . '/helper/memsg/message_sender.php');
  19. require_once (BASE_ROOT_PATH . '/helper/login_helper.php');
  20. require_once (BASE_ROOT_PATH . '/helper/fcode/mfcode.php');
  21. require_once (BASE_ROOT_PATH . '/helper/fcode/operator.php');
  22. require_once (BASE_ROOT_PATH . '/helper/user_session/fcode.php');
  23. require_once (BASE_ROOT_PATH . '/helper/stat_helper.php');
  24. require_once (BASE_ROOT_PATH . '/helper/message/publisher.php');
  25. class queueLogic
  26. {
  27. /**
  28. * push app内容跳转类型
  29. * @var array
  30. */
  31. protected $go_type = array(
  32. '',//跳转到app首页
  33. 'bonus',//红包页
  34. );
  35. /**
  36. * 添加会员积分
  37. * @param unknown $member_info
  38. */
  39. public function addPoint($member_info)
  40. {
  41. $points_model = Model('points');
  42. $points_model->savePointsLog('login', array('pl_memberid' => $member_info['member_id'], 'pl_membername' => $member_info['member_name']), true);
  43. return callback(true);
  44. }
  45. /**
  46. * 添加会员经验值
  47. * @param unknown $member_info
  48. */
  49. public function addExppoint($member_info)
  50. {
  51. $exppoints_model = Model('exppoints');
  52. $exppoints_model->saveExppointsLog('login', array('exp_memberid' => $member_info['member_id'], 'exp_membername' => $member_info['member_name']), true);
  53. return callback(true);
  54. }
  55. /**
  56. * 更新抢购信息
  57. * @param unknown $groupbuy_info
  58. * @throws Exception
  59. */
  60. public function editGroupbuySaleCount($groupbuy_info)
  61. {
  62. $model_groupbuy = Model('groupbuy');
  63. $data = array();
  64. $data['buyer_count'] = array('exp', 'buyer_count+1');
  65. $data['buy_quantity'] = array('exp', 'buy_quantity+' . $groupbuy_info['quantity']);
  66. $update = $model_groupbuy->editGroupbuy($data, array('groupbuy_id' => $groupbuy_info['groupbuy_id']));
  67. if (!$update) {
  68. return callback(false, '更新抢购信息失败groupbuy_id:' . $groupbuy_info['groupbuy_id']);
  69. } else {
  70. return callback(true);
  71. }
  72. }
  73. /**
  74. * 更新使用的代金券状态
  75. * @param $input_voucher_list
  76. * @throws Exception
  77. */
  78. public function editVoucherState($voucher_list)
  79. {
  80. $model_voucher = Model('voucher');
  81. $send = new memsg\message_sender();
  82. foreach ($voucher_list as $store_id => $voucher_info) {
  83. $update = $model_voucher->editVoucher(array('voucher_state' => 2), array('voucher_id' => $voucher_info['voucher_id']), $voucher_info['voucher_owner_id']);
  84. if ($update) {
  85. // 发送用户店铺消息
  86. $send->set('member_id', $voucher_info['voucher_owner_id']);
  87. $send->set('code', 'voucher_use');
  88. $param = array();
  89. $param['voucher_code'] = $voucher_info['voucher_code'];
  90. $param['voucher_url'] = urlShop('member_voucher', 'index');
  91. $send->send($param);
  92. } else {
  93. return callback(false, '更新代金券状态失败vcode:' . $voucher_info['voucher_code']);
  94. }
  95. }
  96. return callback(true);
  97. }
  98. /**
  99. * 下单变更库存销量
  100. * @param unknown $goods_buy_quantity
  101. */
  102. public function createOrderUpdateStorage($goods_buy_quantity)
  103. {
  104. $model_goods = Model('goods');
  105. foreach ($goods_buy_quantity as $goods_id => $quantity) {
  106. $data = array();
  107. $data['goods_storage'] = array('exp', 'goods_storage-' . $quantity);
  108. $data['goods_salenum'] = array('exp', 'goods_salenum+' . $quantity);
  109. $result = $model_goods->editGoodsById($data, $goods_id);
  110. }
  111. if (!$result) {
  112. return callback(false, '变更商品库存与销量失败');
  113. } else {
  114. return callback(true);
  115. }
  116. }
  117. /**
  118. * 取消订单变更库存销量
  119. * @param unknown $goods_buy_quantity
  120. */
  121. public function cancelOrderUpdateStorage($goods_buy_quantity)
  122. {
  123. $model_goods = Model('goods');
  124. foreach ($goods_buy_quantity as $goods_id => $quantity) {
  125. $data = array();
  126. $data['goods_storage'] = array('exp', 'goods_storage+' . $quantity);
  127. $data['goods_salenum'] = array('exp', 'goods_salenum-' . $quantity);
  128. $result = $model_goods->editGoodsById($data, $goods_id);
  129. }
  130. if (!$result) {
  131. return callback(false, '变更商品库存与销量失败');
  132. } else {
  133. return callback(true);
  134. }
  135. }
  136. /**
  137. * 更新F码为使用状态
  138. * @param int $fc_id
  139. */
  140. public function updateGoodsFCode($fc_ids)
  141. {
  142. $update = Model('goods_fcode')->editGoodsFCode(array('fc_state' => 1), array('fc_id' => array('in',$fc_ids)));
  143. if (!$update) {
  144. return callback(false, '更新F码使用状态失败fc_ids:' . implode(',',$fc_ids));
  145. } else {
  146. return callback(true);
  147. } }
  148. /**
  149. * 删除购物车
  150. * @param unknown $cart
  151. */
  152. public function delCart($cart)
  153. {
  154. if (!is_array($cart['cart_ids']) || empty($cart['buyer_id'])) return callback(true);
  155. $del = Model('cart')->delCart('db', array('buyer_id' => $cart['buyer_id'], 'cart_id' => array('in', $cart['cart_ids'])));
  156. if (!$del) {
  157. return callback(false, '删除购物车数据失败');
  158. } else {
  159. return callback(true);
  160. }
  161. }
  162. /**
  163. * 根据商品id更新促销价格
  164. *
  165. * @param int /array $goods_commonid
  166. * @return boolean
  167. */
  168. public function updateGoodsPromotionPriceByGoodsId($goods_id)
  169. {
  170. $update = Model('goods')->editGoodsPromotionPrice(array('goods_id' => array('in', $goods_id)));
  171. if (!$update) {
  172. return callback(false, '根据商品ID更新促销价格失败');
  173. } else {
  174. return callback(true);
  175. }
  176. }
  177. /**
  178. * 根据商品公共id更新促销价格
  179. *
  180. * @param int /array $goods_commonid
  181. * @return boolean
  182. */
  183. public function updateGoodsPromotionPriceByGoodsCommonId($goods_commonid)
  184. {
  185. $update = Model('goods')->editGoodsPromotionPrice(array('goods_commonid' => array('in', $goods_commonid)));
  186. if (!$update) {
  187. return callback(false, '根据商品公共id更新促销价格失败');
  188. } else {
  189. return callback(true);
  190. }
  191. }
  192. /**
  193. * 发送店铺消息
  194. */
  195. public function sendStoreMsg($param)
  196. {
  197. $send = new sendStoreMsg();
  198. $send->set('code', $param['code']);
  199. $send->set('store_id', $param['store_id']);
  200. $send->send($param['param']);
  201. return callback(true);
  202. }
  203. /**
  204. * 发送会员消息
  205. */
  206. public function sendMemberMsg($param)
  207. {
  208. $send = new memsg\message_sender();
  209. $send->set('code', $param['code']);
  210. $send->set('member_id', $param['member_id']);
  211. $send->set('sms_param', $param['sms_param']);
  212. if (!empty($param['number']['mobile'])) $send->set('mobile', $param['number']['mobile']);
  213. if (!empty($param['number']['email'])) $send->set('email', $param['number']['email']);
  214. $send->send($param['param']);
  215. return callback(true);
  216. }
  217. /**
  218. * 生成商品F码
  219. */
  220. public function createGoodsFCode($param)
  221. {
  222. Log::record("createGoodsFCode {$param['goods_commonid']},{$param['fc_count']},{$param['fc_prefix']},{$param['fc_validate']}",Log::DEBUG);
  223. $gen = new fcode\generator($param['goods_commonid'],$param['fc_count'],$param['fc_prefix'],$param['fc_validate']);
  224. $url = $gen->make();
  225. Log::record("createGoodsFCode url={$url}",Log::DEBUG);
  226. return callback(true);
  227. }
  228. /**
  229. * 生成商品二维码
  230. */
  231. public function createGoodsQRCode($param)
  232. {
  233. if (empty($param['goodsid_array'])) {
  234. return callback(true);
  235. }
  236. // 生成商品二维码
  237. require_once(BASE_RESOURCE_PATH . DS . 'phpqrcode' . DS . 'index.php');
  238. $PhpQRCode = new PhpQRCode();
  239. $PhpQRCode->set('pngTempDir', BASE_UPLOAD_PATH . DS . ATTACH_STORE . DS . $param['store_id'] . DS);
  240. foreach ($param['goodsid_array'] as $goods_id) {
  241. // 生成商品二维码
  242. $PhpQRCode->set('date', urlShop('goods', 'index', array('goods_id' => $goods_id)));
  243. $PhpQRCode->set('pngTempName', $goods_id . '.png');
  244. $PhpQRCode->init();
  245. }
  246. return callback(true);
  247. }
  248. /**
  249. * 清理特殊商品促销信息
  250. */
  251. public function clearSpecialGoodsPromotion($param)
  252. {
  253. // 抢购
  254. Model('groupbuy')->delGroupbuy(array('goods_commonid' => $param['goods_commonid']));
  255. // 显示折扣
  256. Model('p_xianshi_goods')->delXianshiGoods(array('goods_id' => array('in', $param['goodsid_array'])));
  257. // 优惠套装
  258. Model('p_bundling')->delBundlingGoods(array('goods_id' => array('in', $param['goodsid_array'])));
  259. // 更新促销价格
  260. Model('goods')->editGoods(array('goods_promotion_price' => array('exp', 'goods_price'), 'goods_promotion_type' => 0), array('goods_commonid' => $param['goods_commonid']));
  261. return callback(true);
  262. }
  263. /**
  264. * 删除(买/卖家)订单全部数量缓存
  265. * @param array $data 订单信息
  266. * @return boolean
  267. */
  268. public function delOrderCountCache($order_info)
  269. {
  270. if (empty($order_info)) return callback(true);
  271. $model_order = Model('order');
  272. if ($order_info['order_id']) {
  273. $order_info = $model_order->getOrderInfo(array('order_id' => $order_info['order_id']), array(), 'buyer_id,store_id');
  274. }
  275. $model_order->delOrderCountCache('buyer', $order_info['buyer_id']);
  276. $model_order->delOrderCountCache('store', $order_info['store_id']);
  277. return callback(true);
  278. }
  279. /**
  280. * 发送兑换码
  281. * @param unknown $param
  282. * @return boolean
  283. */
  284. public function sendVrCode($param)
  285. {
  286. if (empty($param) && !is_array($param)) return callback(true);
  287. $condition = array();
  288. $condition['order_id'] = $param['order_id'];
  289. $condition['buyer_id'] = $param['buyer_id'];
  290. $condition['vr_state'] = 0;
  291. $condition['refund_lock'] = 0;
  292. $code_list = Model('vr_order')->getOrderCodeList($condition, 'vr_code,vr_indate');
  293. if (empty($code_list)) return callback(true);
  294. $content = '';
  295. foreach ($code_list as $v) {
  296. $content .= $v['vr_code'] . ',';
  297. }
  298. $tpl_info = Model('mail_templates')->getTplInfo(array('code' => 'send_vr_code'));
  299. $data = array();
  300. $data['site_name'] = C('site_name');
  301. $data['vr_code'] = rtrim($content, ',');
  302. $message = ncReplaceText($tpl_info['content'], $data);
  303. $sms = new Sms();
  304. $result = $sms->send($param["buyer_phone"], $message);
  305. if (!$result) {
  306. return callback(false, '兑换码发送失败order_id:' . $param['order_id']);
  307. } else {
  308. return callback(true);
  309. }
  310. }
  311. /**
  312. * 添加订单自提表内容
  313. */
  314. public function saveDeliveryOrder($param)
  315. {
  316. if (!is_array($param['order_sn_list'])) return callback(true);
  317. $data = array();
  318. $model_delivery_order = Model('delivery_order');
  319. foreach ($param['order_sn_list'] as $order_id => $v) {
  320. $data['order_id'] = $order_id;
  321. $data['order_sn'] = $v['order_sn'];
  322. $data['addtime'] = $v['add_time'];
  323. $data['dlyp_id'] = $param['dlyp_id'];
  324. $data['reciver_name'] = $param['reciver_name'];
  325. $data['reciver_telphone'] = $param['tel_phone'];
  326. $data['reciver_mobphone'] = $param['mob_phone'];
  327. $insert = $model_delivery_order->addDeliveryOrder($data);
  328. if (!$insert) {
  329. return callback(false, '保存自提站订单信息失败order_sn:' . $v['order_sn']);
  330. }
  331. }
  332. return callback(true);
  333. }
  334. /**
  335. * 发送提货码短信消息
  336. */
  337. public function sendPickupcode($param)
  338. {
  339. $dorder_info = Model('delivery_order')->getDeliveryOrderInfo(array('order_id' => $param['order_id']), 'reciver_mobphone');
  340. $tpl_info = Model('mail_templates')->getTplInfo(array('code' => 'send_pickup_code'));
  341. $data = array();
  342. $data['site_name'] = C('site_name');
  343. $data['pickup_code'] = $param['pickup_code'];
  344. $message = ncReplaceText($tpl_info['content'], $data);
  345. $sms = new Sms();
  346. $result = $sms->send($dorder_info['reciver_mobphone'], $message);
  347. if (!$result) {
  348. return callback(false, '发送提货码短信消息失败order_id:' . $param['order_id']);
  349. } else {
  350. return callback(true);
  351. }
  352. }
  353. /**
  354. * 刷新搜索索引
  355. */
  356. public function flushIndexer()
  357. {
  358. require_once(BASE_DATA_PATH . '/api/xs/lib/XS.php');
  359. $obj_doc = new XSDocument();
  360. $obj_xs = new XS(C('fullindexer.appname'));
  361. $obj_xs->index->flushIndex();
  362. }
  363. /**
  364. * 推送服务
  365. * @param $param array
  366. * 共有三个key : member_id , text, go_type
  367. * @return bool
  368. */
  369. public function upushSendMsg($param)
  370. {
  371. if (empty($param) || empty($param['member_id']) || empty($param['text'])) {
  372. Log::record("push info: 数据有误! param:" . json_encode($param) . "\t session:" . json_encode($_SESSION));
  373. return callback(false);
  374. }
  375. if (!isset($param['go_type'])) {
  376. $param['go_type'] = '';
  377. }
  378. if (!in_array($param['go_type'], $this->go_type)) {
  379. Log::record("push info: go_type参数有误! param:" . json_encode($param) . "\t session:" . json_encode($_SESSION));
  380. return callback(false);
  381. }
  382. $push = new push_sender();
  383. $push->send($param);
  384. return callback(true);
  385. }
  386. /**
  387. * 发短信
  388. * @param $param
  389. *
  390. * @return bool
  391. */
  392. public function sendSMS($param)
  393. {
  394. if (empty($param) || empty($param['mobile']) || empty($param['type'])) {
  395. Log::record("sms info: 数据有误! param:" . json_encode($param),Log::ERR);
  396. return callback(false);
  397. }
  398. try {
  399. $sms = new Sms();
  400. $status = $sms->send($param['mobile'], $param);
  401. Log::record("sms info: status:" . json_encode($status) . "\t param:" . json_encode($param),Log::DEBUG);
  402. } catch (Exception $e) {
  403. Log::record("sms info: fall error\treturn:" . $e->getMessage() . "\t param:" . json_encode($param),Log::ERR);
  404. }
  405. return callback(true);
  406. }
  407. public function sendBonusAndSMS($params)
  408. {
  409. $input_type = $params['member']['input_type'];
  410. if($input_type == 'mobiles') {
  411. $members = member_helper::from_mobiles($params['member']['data'],$error);
  412. }
  413. elseif($input_type == 'sql') {
  414. $members = member_helper::from_sql($params['member']['data']);
  415. }
  416. else {
  417. return callback(false,'sendBonusAndSMS 错误的人员输入类型.');
  418. }
  419. $fSendSms = $params['sms']['open'];
  420. $smscode = $params['sms']['template_id'];
  421. $rate = $params['bonus']['rate'];
  422. $bless = $params['bonus']['bless'];
  423. $amount = $params['bonus']['amount'];
  424. $chunks = array_chunk($members,1000);
  425. foreach ($chunks as $chunk)
  426. {
  427. $chunk = member_helper::exmembers($chunk,$params['member']['ex_lrlz'],$params['member']['ex_brand']);
  428. $ids = [];
  429. foreach ($chunk as $member) {
  430. $ids[] = $member['member_id'];
  431. }
  432. $ret = account_helper::add_bonus($rate,$amount,$ids,$bless);
  433. if($ret == false) continue;
  434. if($fSendSms)
  435. {
  436. $iconut = 0;
  437. $sms = new Sms();
  438. foreach ($chunk as $member)
  439. {
  440. $mobile = $member['member_mobile'];
  441. try {
  442. $status = $sms->send_oper($mobile, $smscode);
  443. Log::record("sms info: status:" . json_encode($status),Log::DEBUG);
  444. } catch (Exception $e) {
  445. Log::record("sms info: fall error\treturn:" . $e->getMessage(),Log::ERR);
  446. }
  447. ++$iconut;
  448. if($iconut == 10) {
  449. sleep(2);
  450. $iconut = 0;
  451. }
  452. }
  453. }
  454. }
  455. return callback(true);
  456. }
  457. public function sendPushOrSMS($params)
  458. {
  459. $input_type = $params['member']['input_type'];
  460. if($input_type == 'mobiles') {
  461. $members = member_helper::from_mobiles($params['member']['data'],$error);
  462. }
  463. elseif($input_type == 'sql') {
  464. $members = member_helper::from_sql($params['member']['data']);
  465. }
  466. else {
  467. return callback(false,'sendBonusAndSMS 错误的人员输入类型.');
  468. }
  469. $send_type = $params['send']['type'];
  470. $content = $params['send']['data'];
  471. $chunks = array_chunk($members,1000);
  472. foreach ($chunks as $chunk)
  473. {
  474. $chunk = member_helper::exmembers($chunk,$params['member']['ex_lrlz'],$params['member']['ex_brand']);
  475. if($send_type == 'sms')
  476. {
  477. $iconut = 0;
  478. $sms = new Sms();
  479. foreach ($chunk as $member)
  480. {
  481. try {
  482. $mobile = $member['member_mobile'];
  483. $status = $sms->send_oper($mobile, $content);
  484. Log::record("sms info: status:" . json_encode($status),Log::DEBUG);
  485. } catch (Exception $e) {
  486. Log::record("sms info: fall error\treturn:" . $e->getMessage(),Log::ERR);
  487. }
  488. ++$iconut;
  489. if($iconut == 10) {
  490. sleep(2);
  491. $iconut = 0;
  492. }
  493. }
  494. }
  495. elseif($send_type == 'push')
  496. {
  497. foreach ($chunk as $member) {
  498. push_helper::oper_push($member['member_id'], $content);
  499. }
  500. }
  501. else {
  502. }
  503. }
  504. return callback(true);
  505. }
  506. /**
  507. * 订阅快递鸟
  508. * @param $param
  509. *
  510. * @return bool
  511. */
  512. public function subscribeKDN($param)
  513. {
  514. if (empty($param) || empty($param['order_sn'])) {
  515. Log::record("kdn_helper: 数据有误! param:" . json_encode($param));
  516. return callback(false);
  517. }
  518. try {
  519. kdn_helper::subscribe($param['order_sn']);
  520. } catch (Exception $e) {
  521. Log::record("kdn_helper: fall error\treturn:" . $e->getMessage() . "\t param:" . json_encode($param));
  522. }
  523. return callback(true);
  524. }
  525. /**
  526. * 根据上传的通讯录生成好友关系
  527. */
  528. public function generateRelations($param)
  529. {
  530. if (empty($param["member_id"])) {
  531. return false;
  532. }
  533. try {
  534. Model("mobile_contacts")->genRelations($param["member_id"]);
  535. } catch (Exception $e) {
  536. Log::record("generateRelations: fall error\treturn:" . $e->getMessage());
  537. }
  538. return true;
  539. }
  540. public function savelog($param)
  541. {
  542. statistics_helper::instance()->add_logs($param);
  543. return callback(true);
  544. }
  545. public function click_goods($param)
  546. {
  547. $goods_id = intval($param['goods_id']);
  548. if($goods_id > 0) {
  549. $mod_goods = Model('goods');
  550. $mod_goods->editGoodsById(array('goods_click' => array('exp', 'goods_click + 1')), $goods_id);
  551. return callback(true);
  552. }
  553. else {
  554. return callback(false,"click_goods 错误的goods_id");
  555. }
  556. }
  557. public function invite_user_register($param)
  558. {
  559. $member_id = $param['member_id'];
  560. $relay_id = $param['relay_id'];
  561. $password = $param['password'];
  562. if($member_id < 0) {
  563. return callback(false,"invite_user_register 错误的member_id");
  564. }
  565. login_helper::onInvite($member_id,$relay_id,$password);
  566. return callback(true);
  567. }
  568. public function onPredeposit($param)
  569. {
  570. Log::record('queue::onPredeposit',Log::DEBUG);
  571. account_helper::onPredeposit($param['change_type'],$param['buyer_id'],$param['order_sn']);
  572. return callback(true);
  573. }
  574. public function onPaySuccess($param)
  575. {
  576. $pay_sn = $param['pay_sn'];
  577. account_helper::onPaySuccess($pay_sn);
  578. return callback(true);
  579. }
  580. public function reset_fcode($param)
  581. {
  582. $pay_sn = $param['pay_sn'];
  583. if(empty($pay_sn)) {
  584. return callback(false);
  585. }
  586. $num = \fcode\operator::reset($pay_sn);
  587. if($num > 0) {
  588. return callback(true);
  589. } else {
  590. return callback(false);
  591. }
  592. }
  593. public function onUseBonus($param)
  594. {
  595. stat_helper::onUseBonus($param);
  596. return callback(true);
  597. }
  598. public function onPublishSpecial($param)
  599. {
  600. $publisher = new message\publisher();
  601. $publisher->add_special($param['user_id'],$param['specials']);
  602. }
  603. public function onDelSpecial($param)
  604. {
  605. $publisher = new message\publisher();
  606. $publisher->del_special($param['user_id'],$param['specials']);
  607. }
  608. }