<?php
/**
 * @copyright   Copyright (c) 2017 https://www.sapixx.com All rights reserved.
 * @license     Licensed (http://www.apache.org/licenses/LICENSE-2.0).
 * @author      pillar<ltmn@qq.com>
 * 文章内容
 */
namespace app\allwin\controller\home;
use app\common\controller\Api;
use app\allwin\model\AllwinConfig;

class Article extends Api{

    /**
     * 服务协议
     * @return void
     */
    public function sla(){
        $info = AllwinConfig::getConfig($this->miniapp_id);
        if(empty($info)){
            $this->error('资源不存在');
        }
        $view['title'] = '服务协议';
        $view['sla']   = $info->sla;
        $this->view->engine->layout(false);
        return view('home/article/rules')->assign($view);
    }
    
    // /**
    //  * 会员制度
    //  * @return void
    //  */
    // public function rules(int $app){
    //     $info  = modelArticle::where(['member_miniapp_id' => $this->miniapp_id,'types' => 1])->find();
    //     if(empty($info)){
    //         $this->error('资源不存在');
    //     }
    //     $view['title'] = '会员制度';
    //     $view['info'] = $info;
    //     $info->views = $info->views+rand(1,5);
    //     $info->save();
    //     $this->view->engine->layout(false);
    //     return view()->assign($view);
    // }
}