<?php
/**
 * Created by PhpStorm.
 * User: blade
 * Date: 2018/6/11
 * Time: 10:50
 */
namespace App\Api\Controller;

ini_set('display_errors', 1);

error_reporting(E_ALL);
use \BaseController\Controller;
Class Uuid extends Controller {

    function index(){
        $table=isset($_GET['table'])?$_GET['table']:'';
        $field=isset($_GET['field'])?$_GET['field']:'';
//        $data=S('DB')->select('SELECT * FROM '.$table.' WHERE len('.$field.') > 64');
        $res=S('DB')->select("UPDATE ".$table." SET '.$field.' = '".UUID()."' WHERE \"length\"(".$field.") < 64 ");
        if(!$res){
            return Render('',3001);
        }
        return Render('',1);

    }
}