<?php

namespace Payment\Lib;

use Dever;

class Manage
{
    public function createAppid($id, $name, $data)
    {
    	$appid = Dever::order('sg');
    	$info = Dever::db('payment/company')->one(array('appid' => $appid));
    	if ($info) {
    		return $this->createAppid($id, $name, $data);
    	}
    	$appsecret = sha1(Dever::uuid());
    	$update['where_id'] = $id;
    	$update['appid'] = $appid;
    	$update['appsecret'] = $appsecret;
        Dever::db('payment/company')->update($update);
    }
}
