59 lines
1.1 KiB
PHP
59 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
* Created by PhpStorm.
|
|
* Name: 商城系统
|
|
* Author: blank
|
|
* Profile: shop
|
|
* Date: 2023/7/27
|
|
* Time: 16:05
|
|
*/
|
|
namespace Yunshop\RedPacket\common;
|
|
|
|
use app\frontend\modules\payment\services\page\reward\PayPageRewardInterface;
|
|
use Yunshop\RedPacket\services\RedOrderService;
|
|
|
|
class RedPacketPayPageReward extends PayPageRewardInterface
|
|
{
|
|
public function whetherHave()
|
|
{
|
|
return $this->getAmount();
|
|
}
|
|
|
|
public function afterPayGive()
|
|
{
|
|
$set = \Setting::get('plugin.red-packet');
|
|
return $set['order_completed'] ? 0 : 1;
|
|
}
|
|
|
|
|
|
public function getTitle()
|
|
{
|
|
return '每日红包额度';
|
|
}
|
|
|
|
public function getDesc()
|
|
{
|
|
return $this->afterPayGive() ? '订单支付后赠送' :'订单完成后赠送';
|
|
}
|
|
|
|
public function _getAmount()
|
|
{
|
|
return (new RedOrderService())->getProportion($this->getOrder(),1);
|
|
}
|
|
|
|
public function getIcon()
|
|
{
|
|
return 'limit.png';
|
|
}
|
|
|
|
public function getUrl()
|
|
{
|
|
return 'DailyRed';
|
|
}
|
|
|
|
public function getMiniUrl()
|
|
{
|
|
return '/packageC/redPacket/daily_red/daily_red';
|
|
}
|
|
|
|
} |