diff --git a/app/backend/modules/goods/observers/SaleObserver.php b/app/backend/modules/goods/observers/SaleObserver.php index cea5edf4..309795be 100644 --- a/app/backend/modules/goods/observers/SaleObserver.php +++ b/app/backend/modules/goods/observers/SaleObserver.php @@ -13,12 +13,20 @@ use Illuminate\Database\Eloquent\Model; class SaleObserver extends \app\common\observers\BaseObserver { - public function saving( $model) - { - + public function saving( $model){ // if (!empty($model->id) &&$model->isDirty()) { // (new \app\common\services\operation\SaleLog($model, 'update')); // } + + // 处理阶梯价信息 + $weightValueLadder = $model->weight_value_ladder ?? []; + foreach($weightValueLadder as $weightValueLadderIndex => $weightValueLadderItem){ + if((float)$weightValueLadderItem['where'] <= 0 || (float)$weightValueLadderItem['num'] <= 0) unset($weightValueLadder[$weightValueLadderIndex]); + } + $model->weight_value_ladder = $weightValueLadder ?? []; + + + } public function updating( $model) diff --git a/app/common/models/Sale.php b/app/common/models/Sale.php index 3f29e163..ecb31575 100644 --- a/app/common/models/Sale.php +++ b/app/common/models/Sale.php @@ -19,32 +19,32 @@ use app\backend\modules\goods\observers\SaleObserver; class Sale extends BaseModel { public $table = 'yz_goods_sale'; - public $attributes = [ - 'max_point_deduct' => '', - 'min_point_deduct' => '', - 'max_balance_deduct' => '', - 'min_balance_deduct' => '', + 'max_point_deduct' => '', + 'min_point_deduct' => '', + 'max_balance_deduct' => '', + 'min_balance_deduct' => '', 'has_all_point_deduct' => 0, - 'all_point_deduct' => 0, - 'is_sendfree' => 0, - 'ed_num' => '', - 'ed_full' => 0, - 'ed_reduction' => 0, - 'ed_money' => '', - 'point' => '', - 'bonus' => 0, - 'award_balance' => 0, - 'pay_reward_balance' => 0, - 'point_type' => 0, - 'max_once_point' => 0, - - 'ed_areas' => '', + 'all_point_deduct' => 0, + 'is_sendfree' => 0, + 'ed_num' => '', + 'ed_full' => 0, + 'ed_reduction' => 0, + 'ed_money' => '', + 'point' => '', + 'bonus' => 0, + 'award_balance' => 0, + 'pay_reward_balance' => 0, + 'point_type' => 0, + 'max_once_point' => 0, + 'ed_areas' => '', 'push_goods_ids' => 0, - 'is_push' => 0, + 'is_push' => 0, + 'weight_value_type' => 0, + 'weight_value_num' => 0, + 'weight_value_ladder' => [], ]; - protected $appends = ['point_deduct_type']; protected $guarded = ['']; diff --git a/min_img/bc_eweima.png b/min_img/bc_eweima.png new file mode 100644 index 00000000..8f93fdbc Binary files /dev/null and b/min_img/bc_eweima.png differ diff --git a/min_img/icon-fontclass-zhiding.png b/min_img/icon-fontclass-zhiding.png new file mode 100644 index 00000000..0efe3b60 Binary files /dev/null and b/min_img/icon-fontclass-zhiding.png differ diff --git a/resources/views/goods/assets/js/components/marketing/promotion.js b/resources/views/goods/assets/js/components/marketing/promotion.js index 5fdbb870..db7e82f8 100644 --- a/resources/views/goods/assets/js/components/marketing/promotion.js +++ b/resources/views/goods/assets/js/components/marketing/promotion.js @@ -3,11 +3,11 @@ define({ template: `