cf-platform/Application/Base/Service/AgentService.class.php

23 lines
394 B
PHP

<?php
namespace Base\Service;
use Base\Facade\Request;
class AgentService {
public function addRecord($params)
{
$data = M('agent', 'tab_')->create($params);
if(!$data){
return $this->getError();
}
$status = M('agent', 'tab_')->add($data);
if ($status) {
$id = M()->getLastInsID();
return $id;
} else {
return 0;
}
}
}