<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/6/30 0030
 * Time: 下午 4:18
 */
/**
 *description 用于返回指定数据格式的类
 *@param $code [int] 返回的状态码
 *@param $message [string] 返回的状态信息
 *@param $data [array] 需要返回的数据
 *
 */
namespace app\lib;
class ErrorInfo
{
    public $code=0;
    public $msg="";

    public static function clear(){
        $code=0;
        $msg="";
        return $code;
    }

    public static function Error($Error){
        return json_encode($Error);
    }

    public static function ErrorMsg($code,$msg){
        $result = array(
            "code" => $code,
            "msg" => $msg
        );
        return json_encode($result);
    }
    public static function printObject($code,$msg,$data){
        $result = array(
            "code" => $code,
            "msg" => $msg,
            "data" => $data
        );
        return json_encode($result);
    }

}