修改:经销商和分销商分红佣金修改 普通商品不参与文创空间相关分红、文创商品不参与普通佣金分红
This commit is contained in:
parent
80d65469d1
commit
aedff1c1fb
|
|
@ -9,6 +9,7 @@ use Yunshop\Commission\models\AgentLevel;
|
|||
use Yunshop\Commission\models\Commission;
|
||||
use Yunshop\Commission\models\Operation;
|
||||
use Yunshop\Commission\models\Order;
|
||||
use Yunshop\CulturalSpace\models\GoodsCulturalSpace;
|
||||
use Yunshop\Hotel\common\models\Hotel;
|
||||
use Yunshop\Hotel\common\models\HotelOrder;
|
||||
use Yunshop\Hotel\common\models\HotelSetting;
|
||||
|
|
@ -482,9 +483,11 @@ class CommissionOrderService
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
foreach ($orderGoods as $key => $og) {
|
||||
// 判断:如果为文创商品-不参与普通分红;普通商品-不参与文创分红。文创商品&不是文创等级 || 非文创商品&文创等级 跳出
|
||||
$isOpenCultural = (int)GoodsCulturalSpace::uniacid()->where('goods_id',$og->goods_id)->value('is_open');
|
||||
if(($isOpenCultural && $levelType != 1) || (!$isOpenCultural && $levelType == 1) ) continue;
|
||||
|
||||
$payment_amount = $og['payment_amount'];
|
||||
//获取商品分销设置信息
|
||||
$commissionGoods = Commission::getGoodsById($og->goods_id)->first();
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ namespace Yunshop\TeamDividend\services;
|
|||
use app\common\models\MemberShopInfo;
|
||||
use app\common\services\finance\PointService;
|
||||
use Carbon\Carbon;
|
||||
use Yunshop\CulturalSpace\models\GoodsCulturalSpace;
|
||||
use Yunshop\SpecialSettlement\common\Recalculate;
|
||||
use Yunshop\TeamDividend\models\GoodsTeamDividend;
|
||||
use Yunshop\TeamDividend\models\MemberChild;
|
||||
|
|
@ -80,17 +81,23 @@ class TeamReturnService
|
|||
public function handle()
|
||||
{
|
||||
if (!$this->team_goods) return;
|
||||
// 普通处理
|
||||
$this->init();
|
||||
$this->totalDividend();
|
||||
$this->running();
|
||||
// 文创处理
|
||||
$this->flat_prize_limit = 0;
|
||||
$this->dividendType = 1;
|
||||
$this->init();
|
||||
$this->totalDividend();
|
||||
$this->running();
|
||||
|
||||
// 判断:文创空间商品 不参与普通分红;非文创空间商品不参与文创空间相关分红
|
||||
$isOpenCultural = (int)GoodsCulturalSpace::uniacid()->where('goods_id',$this->order_goods->goods_id)->value('is_open');
|
||||
if($isOpenCultural){
|
||||
// 开启文创空间
|
||||
// 文创处理
|
||||
$this->flat_prize_limit = 0;
|
||||
$this->dividendType = 1;
|
||||
$this->init();
|
||||
$this->totalDividend();
|
||||
$this->running();
|
||||
}else{
|
||||
// 未开启文创空间
|
||||
// 普通处理
|
||||
$this->init();
|
||||
$this->totalDividend();
|
||||
$this->running();
|
||||
}
|
||||
}
|
||||
|
||||
private function running(){
|
||||
|
|
|
|||
Loading…
Reference in New Issue