// +---------------------------------------------------------------------- declare (strict_types=1); namespace app\timer\model\user; use app\common\model\user\Grade as GradeModel; /** * 用户会员等级模型 * Class Grade * @package app\timer\model\user */ class Grade extends GradeModel { /** * 获取可用的会员等级列表 * @param int $storeId * @return \think\Collection * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public static function getUsableList(int $storeId) { return (new static)->where('status', '=', 1) ->where('is_delete', '=', 0) ->where('store_id', '=', $storeId) ->order(['weight' => 'desc']) ->select(); } }