| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- <?php
- namespace common\logic\order\marketing;
- use addons\Agent\common\enums\ComputingEnum;
- use addons\Agent\common\logic\reward\AgentReward;
- use addons\Agent\common\models\Agent;
- use addons\Agent\common\models\AgentCommissionItemSetting;
- use addons\Agent\common\models\AgentLevel;
- use addons\Mch\common\models\MchGoodsModel;
- use common\enums\AddonsEnum;
- use common\enums\StatusEnum;
- use common\events\data\api\AgentMarketingEvent;
- use common\events\data\api\GoodsDeductEvent;
- use common\models\mall\MallAddons;
- use Exception;
- use phpDocumentor\Reflection\Types\Self_;
- use Yii;
- use yii\helpers\Json;
- /**
- * 经销商内购折扣
- * Class AgentMarketing
- * @Author: hua
- * @DateTime: 2022/1/14 17:22
- * @Copyright: copyright (c) 2021 广东七件事集团
- * @package common\logic\order\marketing渠道分红
- */
- class GoodsDeductMarketing extends BaseMarketing
- {
- public function execute($form)
- {
- }
- public static function compute($item, &$form, &$extra)
- {
- try {
- $mall_id = $form['mall_id'];
- $event = new AgentMarketingEvent($mall_id, $item, $form, $extra);
- Yii::$app->services->events->dispatch($event);
- $data = $event->getResultForm();
- $item = $data['item'];
- $form = $data['form'];
- $extra = $data['extra'];
- return $item;
- } catch (Exception $e) {
- self::setStaticError('经销商内购商品抵扣计算错误:' . $e->getMessage());
- return false;
- }
- }
- public static function getDeductMoney($mall_id,$user_id,$goods_attr_id_arr){
- $event = new GoodsDeductEvent($mall_id, $user_id, $goods_attr_id_arr);
- Yii::$app->services->events->dispatch($event);
- $result = $event->getResultForm();
- return $result;
- }
- }
|