| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace addons\WechatVideoShop\common\logic;
- use addons\WechatVideoShop\common\logic\traits\WeChatCallbackBrandTrait;
- use addons\WechatVideoShop\common\logic\traits\WeChatCallbackCateTrait;
- use addons\WechatVideoShop\common\logic\traits\WeChatCallbackComplaintTrait;
- use addons\WechatVideoShop\common\logic\traits\WeChatCallbackGoodsTrait;
- use addons\WechatVideoShop\common\logic\traits\WeChatCallbackOrderTrait;
- use addons\WechatVideoShop\common\logic\traits\WeChatCallbackRefundTrait;
- use addons\WechatVideoShop\common\logic\traits\WeChatCallbackShopCloseTrait;
- class WeChatCallbackLogic
- {
- use WeChatCallbackBrandTrait, WeChatCallbackComplaintTrait, WeChatCallbackCateTrait, WeChatCallbackGoodsTrait, WeChatCallbackRefundTrait,
- WeChatCallbackOrderTrait, WeChatCallbackRefundTrait, WeChatCallbackShopCloseTrait;
- protected $mall_id;
- protected $shop_id;
- protected $data = [];
- protected $customer_num = 0; // 消费次数
- public function __construct(int $mall_id = 0, int $shop_id = 0, int $customer_num = 0, array $data = [])
- {
- $this->mall_id = $mall_id;
- $this->shop_id = $shop_id;
- $this->customer_num = $customer_num;
- $this->data = $data;
- }
- /**
- * 队列初始化
- * @param array $params
- * @return void
- */
- protected function init(array $params)
- {
- if (!empty($params)) {
- $this->mall_id = $params['mall_id'] ?? 0;
- $this->shop_id = $params['shop_id'] ?? 0;
- $this->customer_num = $params['customer_num'] ?? 0;
- $this->data = $params['data'] ?? [];
- }
- }
-
- /**
- * 不存在的事件都在这里
- * @return void
- */
- public function call(array $params)
- {
- $this->init($params);
- \Yii::error(__METHOD__ . " method not exists [$this->mall_id] -> " . var_export($this->data, true));
- }
- }
|