tablePrefix ='tab_'; /* 执行构造方法 */ parent::__construct($name, $tablePrefix, $connection); } public function addRecord($params) { $data = $this->create($params); if(!$data){ return $this->getError(); } $status = $this->add($data); if ($status) { $id = M()->getLastInsID(); return $id; } else { return 0; } } }