|
|
@@ -15,38 +15,38 @@ use biz\base\classes\BaseClass;
|
|
|
class GoodsSettingClass extends BaseClass
|
|
|
{
|
|
|
|
|
|
- public static $baseFile = '\biz\goods\models\GoodsSetting';
|
|
|
+ public static $baseFile = '\biz\goods\models\GoodsSetting';
|
|
|
|
|
|
- //获取商品涨价比例或金额 shish 2020.5.20
|
|
|
- public static function getRise($merchantId)
|
|
|
- {
|
|
|
- $festRise = FestRiseClass::getAllByCondition(['merchantId' => $merchantId], null, 'festId', 'festId');
|
|
|
- if (empty($festRise)) {
|
|
|
- return [];
|
|
|
- }
|
|
|
- $festId = array_keys($festRise);
|
|
|
- $fest = FestClass::getByIds($festId);
|
|
|
- $arr = [];
|
|
|
- $today = date("Y-n-j");
|
|
|
- $arr = [];
|
|
|
- foreach ($fest as $single) {
|
|
|
- $current = date("Y") . '-' . $single['month'] . '-' . $single['day'];
|
|
|
- $past = date("Y-n-j", (strtotime($current) - 86400));
|
|
|
- $arr = array_merge($arr, $current, $past);
|
|
|
- }
|
|
|
- if (in_array($today, $arr) == false) {
|
|
|
- return [];
|
|
|
- }
|
|
|
- $set = self::getByCondition(['merchantId' => $merchantId]);
|
|
|
- if (empty($set)) {
|
|
|
- util::fail('没有找到涨价需求');
|
|
|
- }
|
|
|
- if ($set['riseSwitch'] == 0) {
|
|
|
- return [];
|
|
|
- }
|
|
|
- $riseType = $set['riseType'];
|
|
|
- $riseAmount = $set['riseAmount'];
|
|
|
- return ['riseType' => $riseType, 'riseAmount' => $riseAmount];
|
|
|
- }
|
|
|
+ //获取商品涨价比例或金额 shish 2020.5.20
|
|
|
+ public static function getRise($merchantId)
|
|
|
+ {
|
|
|
+ return ['riseType' => 0, 'riseAmount' => 96];
|
|
|
+ $festRise = FestRiseClass::getAllByCondition(['merchantId' => $merchantId], null, 'festId', 'festId');
|
|
|
+ if (empty($festRise)) {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ $festId = array_keys($festRise);
|
|
|
+ $fest = FestClass::getByIds($festId);
|
|
|
+ $today = date("Y-n-j");
|
|
|
+ $arr = [];
|
|
|
+ foreach ($fest as $single) {
|
|
|
+ $current = date("Y") . '-' . $single['month'] . '-' . $single['day'];
|
|
|
+ $past = date("Y-n-j", (strtotime($current) - 86400));
|
|
|
+ $arr = array_merge($arr, $current, $past);
|
|
|
+ }
|
|
|
+ if (in_array($today, $arr) == false) {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ $set = self::getByCondition(['merchantId' => $merchantId]);
|
|
|
+ if (empty($set)) {
|
|
|
+ util::fail('没有找到涨价需求');
|
|
|
+ }
|
|
|
+ if ($set['riseSwitch'] == 0) {
|
|
|
+ return [];
|
|
|
+ }
|
|
|
+ $riseType = $set['riseType'];
|
|
|
+ $riseAmount = $set['riseAmount'];
|
|
|
+ return ['riseType' => $riseType, 'riseAmount' => $riseAmount];
|
|
|
+ }
|
|
|
|
|
|
}
|