| 1234567891011121314151617181920212223242526272829303132 |
- <?php
- namespace addons\WechatVideoShop\common\service;
- use addons\WechatVideoShop\common\enums\WechatVideoShopEnums;
- use addons\WechatVideoShop\common\models\WechatVideoShop;
- abstract class AbstractService
- {
- protected $shop_id = 0;
- protected $mall_id = 0;
- protected $customer_num = 0; // 消费次数
- protected $config = [];
- public function __construct(int $shop_id = 0, int $mall_id = 0, int $customer_num = 0)
- {
- $this->mall_id = $mall_id;
- $this->customer_num = $customer_num;
- if (!empty($shop_id)) {
- $this->shop_id = $shop_id;
- // 读取店铺ID
- $this->config = WechatVideoShop::getOne([
- ['id' => $shop_id]
- ], true);
- // 现在需要通过店铺去获取配置信息
- // $this->config = \Yii::$app->services->setting->addons->get($mall_id, WechatVideoShopEnums::ADDONS_NAME, 'basic') ?? [];
- }
- }
- }
|