ppypp伦理天堂,91手机在线视频,免费在线观看黄色毛片,夜夜穞天天穞狠狠穞AV美女按摩

聯系官方銷售客服

1835022288

028-61286886

投訴 已解決 模塊表單中判斷重復提交,如何實現 只查詢 已審核通過 的內容 2 0
遠策(前端設計) VIP會員 OEM版權 2022-10-25 15:37:48 私信
迅睿CMS版本:4.5.6 #模塊表單 #幫助文檔

模塊表單中判斷提交title是否已經重復提交,這里是幫助文檔的代碼。

求助內容:如何實現 判斷是否重復時,只去查詢比對 已審核通過 的內容title。

<?php namespace Phpcmf\Controllers;

/**
 * 二次開發時可以修改本文件,不影響升級覆蓋
 */

class Test extends \Phpcmf\Home\Mform
{

    public function index() {
        $this->_Home_List();
    }

    public function show() {
        $this->_Home_Show();
    }

    public function post() {
    
        if (IS_POST) {
            // 這里表示提交之前
            $post = \Phpcmf\Service::L('input')->post('data');
            $this->index = $this->_Module_Row($this->cid);
            if (\Phpcmf\Service::M()->table($this->init['table'])
            ->where('cid', $this->index['id'])
            ->where('title', $post['title'])->counts()) {
                $this->_json(0, 'title字段的值已經存在,不能重復提交');
            }
            
        }
    
        $this->_Home_Post();
    }
}

解決方案