'asc']) { $model = new static; $wxappId = $wxappId ? $wxappId : $model::$wxapp_id; return $model->where('status', '=', '1') ->where('is_delete', '=', '0') ->where('wxapp_id', '=', $wxappId) ->order($order) ->select(); } /** * 验证等级权重是否存在 * @param int $weight 验证的权重 * @param int $gradeId 自身的等级ID * @return bool */ public static function checkExistByWeight($weight, $gradeId = 0) { $model = new static; $gradeId > 0 && $model->where('grade_id', '<>', (int)$gradeId); return $model->where('weight', '=', (int)$weight) ->where('is_delete', '=', 0) ->value('grade_id'); } }