UpdateController.class.php 1.21 KB
<?php
/**
 * Created by PhpStorm.
 * User: zhoutao
 * Date: 2018/1/8
 * Time: 下午3:54
 */

namespace Apicp\Controller\VhLiveOperate;

use Common\Common\Constant;
use Common\Common\Vhall;
use Common\Service\MainService;

class UpdateController extends AbstractController
{
    /**
     * Update
     * @author houyingcai
     * @desc 更新接口
     * @return bool
     */
    public function Index_post()
    {
        $postData = I('post.');

        // 初始化微吼直播类
        $vh_class = Vhall::instance();

        //获取直播中 更多设置
        $setting = $this->getLiveSetting($postData, Constant::VH_MORE_SETTING_FIELD);

        // 获取数据表原始数据
        $vh_set_info = $this->vhall_service->get_by_conds(['vh_id' => $postData['id']]);

        // 获取微吼直播详情
        $uc_info = $vh_class->details($postData['id']);

        $postData['liveHost']=$postData['teacher_name'];
        // 更新直播数据
        $vh_class->update($postData);

        // 更新设置
        $this->vhall_service->update_by_conds(['vh_id' => $postData['id']], $setting);

        // 更新发布消息
        $this->update_send_msg($postData, $uc_info, $vh_set_info);

        return true;
    }

}