| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 | <?phpnamespace App\Http\Home\Audio;use App\Http\Home\HttpBaseController;use Illuminate\Support\Facades\DB;use Illuminate\Support\Facades\Request;class DownloadController extends HttpBaseController{    private array $softInfo = [        'id' => 7,        'title' => "星优音频处理器",    ];    public function __construct()    {        parent::__construct();    }    /**     * 首页     */    public function index()    {        $deviceType = Request::input('type'); // '操作系统类型 windows linux android ios        if (!in_array($deviceType, ['windows', 'linux', 'android', 'ios'])) {            $deviceType = 'windows';        }        // 获取下载地址,然后跳转        $info = DB::table('product_version')            ->where('os_type', $deviceType)            ->where('id', $this->softInfo['id'])            ->where('status', 1)            ->orderBy('id', 'desc')            ->first();        if (empty($info)) {            $url = '/';        } else {            $url = $info->download_url;        }        return responseMessage(1001, '', $url);    }}
 |