LiveOrderController.class.php 962 Bytes
<?php
/**
 * Created by PhpStorm.
 * User: yingcai
 * Date: 2018/2/1
 * Time: 下午7:07
 */

namespace Apicp\Controller\LiveOrder;

use Common\Common\Constant;
use Common\Common\Order;

class LiveOrderController extends AbstractController
{

    /**
     * LiveOrder
     * @author houyingcai
     * @desc 企业是否购买过员圈直播接口
     * @return array|bool 购买规则
                array(
                    'is_live_order' => 1, // 企业是否购买了直播(1=是,2=否)
                )
     */
    public function Index_post()
    {

        $orderServ = &Order::instance();
        // 企业是否购买过员圈直播
        $result = $orderServ->fetchOrderLiveList(['ordType' => Constant::ORDER_TYPE_PRODUCT_LIVE]);

        $isLiveOrder = $result['total'] ? Constant::LIVE_BUY_TRUE : Constant::LIVE_BUY_FALSE;

        $this->_result = [
            'is_live_order' => $isLiveOrder,
        ];

        return true;
    }
}