|
|
@@ -24,25 +24,36 @@ class ShopClass extends BaseClass
|
|
|
//需要算上包装费
|
|
|
public static function needAddPackCost($ghsShop, $customId, $orderAmount = 0)
|
|
|
{
|
|
|
- $lackExpend = $ghsShop->lackExpend ? floatval($ghsShop->lackExpend) : 0;
|
|
|
- $packCost = $ghsShop->packCost ? floatval($ghsShop->packCost) : 0;
|
|
|
- if ($lackExpend <= 0 || $packCost <= 0) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- $current = date("Y_m_d");
|
|
|
- $key = 'ghs_custom_today_has_get_pack_cost_' . $current . '_' . $customId;
|
|
|
- $has = Yii::$app->redis->executeCommand('GET', [$key]);
|
|
|
- if (!empty($has) && $has == 1) {
|
|
|
- return false;
|
|
|
- }
|
|
|
- if ($orderAmount > 0) {
|
|
|
- if ($orderAmount < $lackExpend) {
|
|
|
+ if (isset($ghsShop->pfLevel) && $ghsShop->pfLevel == 1) {
|
|
|
+ $current = date("Y_m_d");
|
|
|
+ $key = 'ghs_custom_today_has_get_pack_cost_' . $current . '_' . $customId;
|
|
|
+ $has = Yii::$app->redis->executeCommand('GET', [$key]);
|
|
|
+ if (!empty($has) && $has == 1) {
|
|
|
+ return false;
|
|
|
+ } else {
|
|
|
return true;
|
|
|
}
|
|
|
} else {
|
|
|
- return true;
|
|
|
+ $lackExpend = $ghsShop->lackExpend ? floatval($ghsShop->lackExpend) : 0;
|
|
|
+ $packCost = $ghsShop->packCost ? floatval($ghsShop->packCost) : 0;
|
|
|
+ if ($lackExpend <= 0 || $packCost <= 0) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ $current = date("Y_m_d");
|
|
|
+ $key = 'ghs_custom_today_has_get_pack_cost_' . $current . '_' . $customId;
|
|
|
+ $has = Yii::$app->redis->executeCommand('GET', [$key]);
|
|
|
+ if (!empty($has) && $has == 1) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if ($orderAmount > 0) {
|
|
|
+ if ($orderAmount < $lackExpend) {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ return false;
|
|
|
}
|
|
|
- return false;
|
|
|
}
|
|
|
|
|
|
public static function getNewShopList()
|