|
|
@@ -2,14 +2,9 @@
|
|
|
|
|
|
namespace bizMall\goods\classes;
|
|
|
|
|
|
-use bizMall\goods\services\GoodsCategoryService;
|
|
|
-use bizMall\goods\services\GoodsStyleService;
|
|
|
use bizMall\saas\classes\FestClass;
|
|
|
use bizMall\saas\classes\FestRiseClass;
|
|
|
-use common\components\business;
|
|
|
-use common\components\stringUtil;
|
|
|
use common\components\util;
|
|
|
-use Yii;
|
|
|
use bizMall\base\classes\BaseClass;
|
|
|
|
|
|
class GoodsSettingClass extends BaseClass
|
|
|
@@ -18,25 +13,25 @@ class GoodsSettingClass extends BaseClass
|
|
|
public static $baseFile = '\bizMall\goods\models\GoodsSetting';
|
|
|
|
|
|
//获取商品涨价比例或金额 ssh 2020.5.20
|
|
|
- public static function getRise($sjId)
|
|
|
+ public static function getRise($mainId)
|
|
|
{
|
|
|
- $festRise = FestRiseClass::getAllByCondition(['sjId' => $sjId], 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(['sjId' => $sjId]);
|
|
|
+// $festRise = FestRiseClass::getAllByCondition(['mainId' => $mainId], 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(['mainId' => $mainId]);
|
|
|
if (empty($set)) {
|
|
|
util::fail('没有找到涨价需求');
|
|
|
}
|