public function testInsertOrIgnore() { Db::init($this->conf); $db = Db::get('hm_blog'); $result = $db->table('article')->autoInc('article_id')->saveBody(['article_id' => 10000, 'title' => 'test article', 'user_id' => 40, 'create_time' => time(), 'rv_content' => 2, 'cate_id' => 22, 'comment_num' => 1, 'status' => 1])->insertIgnore(); var_dump($result); }
/** * 查询文本 Db::queryText($textid); */ public function queryText($arr_signid) { return Db::queryText($arr_signid); }
/** * Shutdown handler */ public function shutdownHandler() { $result = $this->timer->getResult(); $str[] = '[time:'; foreach ($result as $key => $time) { $str[] = ' ' . $key . '=' . $time; } $str[] = ']'; Logger::notice(implode('', $str) . ' status=' . $this->endStatus); Logger::flush(); if (true !== Conf::get('wisphp.disable_db')) { //做一些清理 \wisphp\db\TxScope::rollbackAll(); \wisphp\db\Db::close(); } }