<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------

namespace Home\Controller;
use Think\Model;
use Common\Model\MemberModel;

/**
 * 前台控制器
 */
class ToolsController extends HomeController {

	public function _initialize(){
	    
	    exit();

	}

	public function index() {
	    echo 1;
	}
	
	public function clearCache(){
	    S('sys_category_list',null);
	    S('sys_agent_list',null);
	    S('sys_merchant_list',null);
	    S('sys_factory_list',null);
	    S('sys_machine_list',null);
	    S('sys_member_list',null);
	    S('sys_user_nickname_list',null);
	}
	
	
	


    public function machineBox(){
        exit;
        $map['mac_id'] = 51;
        $lists = $this->getAllRows('MachineBox',true,$map);
        sleep(2);

        foreach ($lists as $v){
            unset($v['id']);
            $v['mac_id'] = 52;
            $v['create_time'] = time();
            $v['update_time'] = time();
            $v['status'] = 1;
            M('MachineBox')->add($v);
        }
    }
    
    
    public function goods(){
        $map['mid'] =28;
        $map['status']=1;
        $lists = M('Goods')->where($map)->select();
        foreach($lists as $v){
            unset($v['id']);
            $v['mid'] = 29;
            $v['create_time'] = time();
            $v['update_time'] = time();
            M('Goods')->add($v);
        }
    }


}