DownloadController.class.php 640 Bytes
<?php
/**
 * 微信(H5端)下载附件
 * Created by PhpStorm.
 * User: mr.song
 * Date: 2016/7/22
 * Time: 16:49
 */
namespace Api\Controller\Attachment;

use Common\Common\Msg;

class DownloadController extends AbstractController
{

    public function Index()
    {

        $at_id = I("get.atid");

        // 判断附件ID是否为空
        if (empty($at_id)) {
            $this->_set_error('_ERR_ATID_EMPTY');
            return false;
        }

        // 推送文件到应用主页面
        $msgService = new Msg();
        $msgService->sendFile($this->_login->user["memUid"], '', '', $at_id);

        return true;
    }
}