<?php
/**
 *  ╔═══════════════════════════════════════════════════╗
 *  ║                                                   ║
 *  ║     ██╗  ██╗   █████╗    ██████╗                  ║
 *  ║     ██║  ██║  ██╔══██╗  ██╔═══██╗                 ║
 *  ║     ███████║  ███████║  ██║   ██║                 ║
 *  ║     ██╔══██║  ██╔══██║  ██║   ██║                 ║
 *  ║     ██║  ██║  ██║  ██║  ╚██████╔╝   SNS           ║
 *  ║                                                   ║    
 *  ║                                                   ║    
 *  ║     © 2023 HaoSNS™ All Rights Reserved            ║
 *  ║     官方网站: https://www.haosns.com                *
 *  ║     本代码由赣州乐易网络科技有限公司®提供             *
 *  ║                                                    *
 *  ║   未经授权禁止复制、传播或用于其他商业目的            *
 *  ║                                                   ║
 *  ╚═══════════════════════════════════════════════════╝
 */

namespace app\common\logic;

use app\common\enum\DiscountEnum;
use app\common\model\DiscountGoods;
use app\common\model\DiscountGoodsItem;
use app\common\model\Goods;
use app\common\model\User;
use app\common\model\UserLevel;

/**
 * 会员折扣逻辑层
 * Class DiscountLogic
 * @package app\common\logic
 */
class DiscountLogic
{


    /**
     * @notes 根据用户当前等级获取商品折扣价 tips：如果商品没折扣价则不返回
     * @param $userId
     * @param $goodsIds
     * @return array
     * @author lgp
     * @date 2022/5/7 15:09
     * tips: 返回数据格式 =>[
     *      'goods_id'  => [
     *          '规格id'  => []
     *      ]
     *  ]
     */
    public static function getGoodsDiscount(int $userId, array $goodsIds)
    {
        // $userLevel = User::where(['id' => $userId])
        //     ->field('id,level')
        //     ->with('user_level')
        //     ->find();
        // $levelDiscount = $userLevel->discount;
        
        // $goodsLists = Goods::where(['id' => $goodsIds])->with('spec_value_list')->field('id')->select()->toArray();
        $discountData = [];

        return $discountData;
    }
}