迅睿CMS框架是一款PHP8高性能·簡(jiǎn)單易用的CMS開(kāi)源開(kāi)發(fā)框架,基于MIT開(kāi)源許可協(xié)議發(fā)布,免費(fèi)且不限制商業(yè)使用,是免費(fèi)開(kāi)源的產(chǎn)品,以萬(wàn)端互聯(lián)為設(shè)計(jì)理念,支持的微信公眾號(hào)、小程序、APP客戶端、移動(dòng)端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
聯(lián)系官方銷售客服
1835022288
028-61286886
http://223987.com/doc/1084.html
$this->content_model->table(SITE_ID.'_'.MOD_DIR)->where('title', $save[1]['title'])->update(0, ['updatetime'=>SYS_TIME]);
遇到不會(huì)寫(xiě)代碼,就在帖子里面加幾塊錢的懸賞(設(shè)置懸賞),系統(tǒng)會(huì)將賞金貼推送到微信和QQ群,可以得到更多人的幫助
回復(fù)@迅??蚣芗夹g(shù)-胡老師 老師你好。
// 驗(yàn)證標(biāo)題重復(fù)
if ($this->content_model->table(SITE_ID.'_'.MOD_DIR)->where('title', $save[1]['title'])->counts()) {
echo '重復(fù)';exit;
}
不行啊,不去掉重復(fù)的發(fā)布不了,去掉重復(fù)的就2個(gè)標(biāo)題相同的內(nèi)容了。
// 驗(yàn)證標(biāo)題重復(fù) if ($this->content_model->table(SITE_ID.'_'.MOD_DIR)->where('title', $save[1]['title'])->counts()) { $this->content_model->table(SITE_ID.'_'.MOD_DIR)->where('title', $save[1]['title'])->update(0, ['updatetime'=>SYS_TIME]); echo '重復(fù)';exit; }
回復(fù)@NGCM 發(fā)布的更新時(shí)間變了,但是內(nèi)容還是之前的。
<?php $this->_module_init('article'); // news 是模塊目錄 if ($_GET['action'] == 'category') { // 顯示欄目 if (!$this->module['category']) { echo '模塊【'.$this->module['dirname'].'】沒(méi)有創(chuàng)建欄目'; } foreach ($this->module['category'] as $t) { if ($t['child'] == 0 && $t['tid'] == 1) { echo '<h1>'.$t['name'].'<=>'.$t['id'].'</h1>'.PHP_EOL; } } } else { // 入庫(kù)數(shù)據(jù) $data = $_REQUEST; // 發(fā)布者id 1 $data['uid'] = 1; // 發(fā)布者賬號(hào) admin $data['author'] = 'admin'; // 主表字段 $fields[1] = $this->get_cache('table-'.SITE_ID, $this->content_model->dbprefix(SITE_ID.'_'.MOD_DIR)); $cache = $this->get_cache('table-'.SITE_ID, $this->content_model->dbprefix(SITE_ID.'_'.MOD_DIR.'_category_data')); $cache && $fields[1] = array_merge($fields[1], $cache); // 附表字段 $fields[0] = $this->get_cache('table-'.SITE_ID, $this->content_model->dbprefix(SITE_ID.'_'.MOD_DIR.'_data_0')); // 去重復(fù) $fields[0] = array_unique($fields[0]); $fields[1] = array_unique($fields[1]); // 格式化入庫(kù)字段 // 一般是格式化非文本類的字段(例如多文件上傳、復(fù)選框、聯(lián)動(dòng)字段等等) // 這里需要按采集資料的格式入庫(kù)格式化字段, // 開(kāi)始?xì)w類存儲(chǔ) $save = []; // 主表附表歸類 foreach ($fields as $ismain => $field) { foreach ($field as $name) { isset($data[$name]) && $save[$ismain][$name] = $data[$name]; } } if (!$data['catid']) { exit('欄目為空'); } $save[1]['uid'] = $save[0]['uid'] = $data['uid']; $save[1]['catid'] = $save[0]['catid'] = $data['catid']; $save[1]['url'] = ''; $save[1]['status'] = 9; //9表示正常發(fā)布,1表示審核里面 $save[1]['hits'] = 0; $save[1]['displayorder'] = 0; $save[1]['link_id'] = 0; $save[1]['inputtime'] = $save[1]['updatetime'] = SYS_TIME + rand(0, 7200); $save[1]['inputip'] = '127.0.0.1'; //$save[1]['keywords'] = dr_get_keywords( $save[1]['title']); // 按插件提取關(guān)鍵詞 //$save[1]['description'] = dr_get_description( $save[0]['content'], 100); // 在內(nèi)容里面提取100個(gè)子作為描述 // 驗(yàn)證標(biāo)題重復(fù) if ($this->content_model->table(SITE_ID.'_'.MOD_DIR)->where('title', $save[1]['title'])->counts()) { echo '重復(fù)';exit; } $rt = $this->content_model->save_content(0, $save); if ($rt['code']) { /* // 用于發(fā)布成功后生成靜態(tài)文件代碼 //dr_html_auth($_SERVER['SERVER_ADDR']); //dr_catcher_data(SITE_URL.'index.php?s='.MOD_DIR.'&c=html&m=showfile&id='.$rt['id']); $atcode = 'chtml_'.SITE_ID.'_'.MOD_DIR.'_'.$rt['code']; \Phpcmf\Service::L('cache')->set_auth_data($atcode, $rt['code'], SITE_ID); dr_catcher_data(SITE_URL.'index.php?s='.MOD_DIR.'&c=html&m=showfile&id='.$rt['code'].'&atcode='.$atcode); $save[1]['id'] = $save[0]['id'] = $rt['code']; \Phpcmf\Service::L('router')->show_url(\Phpcmf\Service::C()->module, $save[1]); */ exit('成功'); } else { exit('失敗'); } } exit;
// 驗(yàn)證標(biāo)題重復(fù) if ($rs = $this->content_model->table(SITE_ID.'_'.MOD_DIR)->where('title', $save[1]['title'])->getRow()) { $this->content_model->table(SITE_ID.'_'.MOD_DIR.'_tableid_'.$rs['tableid'])->update($rs['id'], ['content'=>$save[0]['content']]); echo '更新成功';exit; }
回復(fù)@小波工作室 小波不行啊,發(fā)布的時(shí)間都不更新
// 驗(yàn)證標(biāo)題重復(fù) if ($rs = $this->content_model->table(SITE_ID.'_'.MOD_DIR)->where('title', $save[1]['title'])->getRow()) { $this->content_model->table(SITE_ID.'_'.MOD_DIR)->update($rs['id'], ['updatetime'=>SYS_TIME]); $this->content_model->table(SITE_ID.'_'.MOD_DIR.'_tableid_'.$rs['tableid'])->update($rs['id'], ['content'=>$save[0]['content']]); echo '更新成功';exit; }
回復(fù)@小波工作室
Table 'www_lycxz_com.dr_1_article_tableid_0' doesn't exist模板標(biāo)簽解析文件:/www/wwwroot/www.lycxz.com/dayrui/System/Database/MySQLi/Connection.php(292)錯(cuò)誤頁(yè)面訪問(wèn)地址:https://www.lycxz.com/api/Caiji.php?action=post
https://www.lycxz.com/api/Caiji.php?action=post
// 驗(yàn)證標(biāo)題重復(fù) if ($rs = $this->content_model->table(SITE_ID.'_'.MOD_DIR)->where('title', $save[1]['title'])->getRow()) { $this->content_model->table(SITE_ID.'_'.MOD_DIR)->update($rs['id'], ['updatetime'=>SYS_TIME]); $this->content_model->table(SITE_ID.'_'.MOD_DIR.'_data_'.$rs['tableid'])->update($rs['id'], ['content'=>$save[0]['content']]); echo '更新成功';exit; }
完畢,領(lǐng)賞
遇到不會(huì)寫(xiě)代碼,就在帖子里面加幾塊錢的懸賞(設(shè)置懸賞),系統(tǒng)會(huì)將賞金貼推送到微信和QQ群,可以得到更多人的幫助
回復(fù)@迅??蚣芗夹g(shù)-胡老師 老師你好。
$this->content_model->table(SITE_ID.'_'.MOD_DIR)->where('title', $save[1]['title'])->update(0, ['updatetime'=>SYS_TIME]);
// 驗(yàn)證標(biāo)題重復(fù)
if ($this->content_model->table(SITE_ID.'_'.MOD_DIR)->where('title', $save[1]['title'])->counts()) {
echo '重復(fù)';exit;
}
不行啊,不去掉重復(fù)的發(fā)布不了,去掉重復(fù)的就2個(gè)標(biāo)題相同的內(nèi)容了。
回復(fù)@NGCM 發(fā)布的更新時(shí)間變了,但是內(nèi)容還是之前的。
回復(fù)@小波工作室

小波不行啊,發(fā)布的時(shí)間都不更新
回復(fù)@小波工作室
Table 'www_lycxz_com.dr_1_article_tableid_0' doesn't exist
模板標(biāo)簽解析文件:/www/wwwroot/www.lycxz.com/dayrui/System/Database/MySQLi/Connection.php(292)
錯(cuò)誤頁(yè)面訪問(wèn)地址:https://www.lycxz.com/api/Caiji.php?action=post
https://www.lycxz.com/api/Caiji.php?action=post
完畢,領(lǐng)賞