| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace common\logic\order\marketing;
- use common\enums\AddonsEnum;
- use common\models\mall\MallAddons;
- /**
- * Class FullReduceMarketing
- * 满减计算
- * @Author: lun
- * @DateTime: 2021/9/30 0030 14:53
- * @Copyright: copyright (c) 2021 广东七件事集团
- * @package common\logic\order\marketing
- */
- class RedpackMarketing extends BaseMarketing{
- public function execute($form){}
- /**
- * 满减计算
- * @Author: lun
- * @DateTime: 2021/10/6 0006 10:55
- * @Copyright: copyright (c) 2021 广东七件事集团
- * @param $item
- * @param $form
- * @return mixed
- */
- public static function compute($item, &$form,&$extra = [])
- {
- try {
- // 检测是否有安装红包拓客应用
- if (MallAddons::isInstall($item['mch_order_info']['mall_id'], AddonsEnum::ADDONS_NAME_REDPACK)) {
- $marketing = new \addons\Redpack\common\logic\order\RedpackMarketing();
- $item = $marketing::compute($item, $form,$extra);
- if ($item == false) throw new \Exception($marketing::getStaticError());
- }
- return $item;
- } catch (\Exception $e) {
- self::setStaticError($e->getMessage());
- return false;
- }
- }
- }
|