where('is_enabled', 1) ->where('template_type', $template_type) ->select( 'products.id', 'products.price', 'products.type', 'products.given', 'products.is_default', 'products.sequence' ) ->orderBy('sequence')->get(); } /** * 获取id下对应的充值和赠送额 * @param $product_id * @return mixed */ public static function getProductGivenAmount($product_id) { return self::where('id', $product_id)->select('given','price')->first(); } static function detail($id) { return self::find($id); } }