<?php
/**
 *  ╔═══════════════════════════════════════════════════╗
 *  ║                                                   ║
 *  ║     ██╗  ██╗   █████╗    ██████╗                  ║
 *  ║     ██║  ██║  ██╔══██╗  ██╔═══██╗                 ║
 *  ║     ███████║  ███████║  ██║   ██║                 ║
 *  ║     ██╔══██║  ██╔══██║  ██║   ██║                 ║
 *  ║     ██║  ██║  ██║  ██║  ╚██████╔╝   SNS           ║
 *  ║                                                   ║    
 *  ║                                                   ║    
 *  ║     © 2023 HaoSNS™ All Rights Reserved            ║
 *  ║     官方网站: https://www.haosns.com                *
 *  ║     本代码由赣州乐易网络科技有限公司®提供             *
 *  ║                                                    *
 *  ║   未经授权禁止复制、传播或用于其他商业目的            *
 *  ║                                                   ║
 *  ╚═══════════════════════════════════════════════════╝
 */

namespace app\adminapi\controller;

/**
 * 首页导航菜单
 * Class GoodsController
 * @package app\adminapi\controller\goods
 */
class ArticleRed extends BaseAdminController
{
   
    /**
     * 分享列表
     */
    public function list()
    {
        $data = [
           
            'red_day_ID_limit'=>\app\common\service\ConfigService::get('articlered','red_day_ID_limit',''),
            
            'red_day_IP_limit'=>\app\common\service\ConfigService::get('articlered','red_day_IP_limit',''),
            
            'red_day_phone_limit'=>\app\common\service\ConfigService::get('articlered','red_day_phone_limit',''),
            
            'red_fee'=>\app\common\service\ConfigService::get('articlered','red_fee',''),
            
            'red_mode'=>\app\common\service\ConfigService::get('articlered','red_mode',''),
            
            'titlred_opene'=>\app\common\service\ConfigService::get('articlered','titlred_opene',''),
            
            'red_receive_allow_ip'=>\app\common\service\ConfigService::get('articlered','red_receive_allow_ip',''),
        ];

        return show(config('status.success'),'',$data);
        
    }

    public function set()
    {
        
        $params = $this->request->post();

         // red_day_ID_limit
        // : 
        // "2"
        // red_day_IP_limit
        // : 
        // 0
        // red_day_phone_limit
        // : 
        // "22"
        // red_fee
        // : 
        // "12"
        // red_mode
        // : 
        // "99"
        // red_open
        // : 
        // false
        // red_pay_mode
        // : 
        // 0
        // red_receive_allow_ip
        // : 
        
        \app\common\service\ConfigService::set('articlered','red_day_ID_limit',$params['red_day_ID_limit']);
        \app\common\service\ConfigService::set('articlered','red_day_IP_limit',$params['red_day_IP_limit']);
        \app\common\service\ConfigService::set('articlered','red_day_phone_limit',$params['red_day_phone_limit']);
        \app\common\service\ConfigService::set('articlered','red_fee',$params['red_fee']);
        \app\common\service\ConfigService::set('articlered','red_mode',$params['red_mode']);
        \app\common\service\ConfigService::set('articlered','red_open',$params['titlred_opene']);
        \app\common\service\ConfigService::set('articlered','red_receive_allow_ip',$params['red_receive_allow_ip']);

        return show(config('status.success'),'设置成功');
    }
    
}


