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

聯(lián)系官方銷售客服

1835022288

028-61286886

投訴 已解決 關(guān)于網(wǎng)站表單發(fā)布后的回調(diào),前端發(fā)布回調(diào) 10 791
迅睿CMS版本:4.3.13 懸賞:2元

PHP程序里面

各位大神,求助下,關(guān)于網(wǎng)站表單發(fā)布后的回調(diào),前端發(fā)布回調(diào),參考:http://www.zbshanke.com/doc/897.html 寫回調(diào), 沒問題,但是如果我是在網(wǎng)站會(huì)員中心發(fā)布的網(wǎng)站表單,就不能回調(diào)了,也就是這個(gè)地址發(fā)布的可以回調(diào):http://ooxx.com/index.php?s=form&c=zixun&m=post 但是這個(gè)地址發(fā)布的不能回調(diào)http://ooxx.com/index.php?s=member&app=form&c=zixun&m=add。求助了下老大,老大說會(huì)員中心的網(wǎng)站表單發(fā)布沒有寫回調(diào)方法,只能在這邊求助下大神們,我需要在會(huì)員中心網(wǎng)站表單發(fā)布后,調(diào)用回調(diào)完成另外一個(gè)表的更新和消息的發(fā)送。有什么方法可以做到,謝謝了!

解決方案
  • 發(fā)一下控制器的代碼,index.php?s=member&app=form&c=zixun&m=add。和前端控制器稍微改下就行了

  • 控制器里面加一個(gè)這個(gè)啊,一樣的原理

    // 新增回調(diào)函數(shù)
         protected function _Call_Post($data) {
            $cp = parent::_Call_Post($data);
            if ($cp['code']) {
                // 這里寫 提交成功時(shí)的 你的程序代碼
                $this->_json($cp['code'], '提交表單成功', $cp['data']);
            } else {
                $this->_json(0, '提交失敗', $cp['data']);
            }
        }
  • 回復(fù)@官方研發(fā)技術(shù)-實(shí)習(xí) 大神,您好,我復(fù)制了個(gè)add方法,改名為hufu。代碼如下,麻煩您看下!

    public function hufw() {
        $qid = \Phpcmf\Service::L('input')->get('qid');
        $cc = \Phpcmf\Service::M()->db->table(SITE_ID."_form_zixun")->where("id", $qid)->get()->getRowArray();
    
        if(IS_POST){
            $_POST["data"]["title"] = $cc["title"];
            $_POST["data"]["glzlid"] = $cc["glzlid"];
            $_POST["data"]["sjlx"] = '1';
            list($tpl) = $this->_Post(0);
        }
    
        \Phpcmf\Service::V()->assign([
            'cc' => $cc,
        ]);
        \Phpcmf\Service::V()->display('form_hf.html');
    }
    
        // 新增回調(diào)函數(shù)
        protected function _Call_Post($data) {
            $cp = parent::_Call_Post($data);
            //自己業(yè)務(wù)處理
    //        exit("222");
            $qid = $data["1"]["hfwtid"];
            $cc = \Phpcmf\Service::M()->db->table(SITE_ID."_form_zixun")->where("id", $qid)->get()->getRowArray();
            //更新關(guān)聯(lián)問題的狀態(tài)為已回復(fù)
            $dataa = array(
                'shifouhuifu' => '1',
            );
            \Phpcmf\Service::M()->db->table('1_form_zixun')->where('id', $qid)->update($dataa);
            $datab = array(
                'uid' => $cc["uid"],
                'author' => $cc["author"],
            );
            \Phpcmf\Service::L('Notice')->send_notice('item_0_2', $datab);
    
            if ($cp['code']) {
                // 這里寫 提交成功時(shí)的 你的程序代碼
                $this->_json($cp['code'], '提交表單成功', $cp['data']);
            } else {
                $this->_json(0, '提交失敗', $cp['data']);
            }
        }
    it小民工!
  • 回復(fù)@鄭中建 嗯,我就是加這個(gè),但是不執(zhí)行,在父級(jí)_Save方法中被攔截了,您可以試下,有可能是我姿勢(shì)不對(duì) ??

    it小民工!
  • 回復(fù)@官方研發(fā)技術(shù)-實(shí)習(xí) 好呢 下面是全部代碼,麻煩您看下

    <?php namespace Phpcmf\Controllers\Member;
    
    /**
     * 二次開發(fā)時(shí)可以修改本文件,不影響升級(jí)覆蓋
     */
    
    class Zixun extends \Phpcmf\Member\Form
    {
    
        public function index() {
            $where = 'sjlx=0'; // 新的條件組合
            if ($this->init['where_list']) {
                $this->init['where_list'].= ' AND '.$where;
                // 考慮到父類也許有可能會(huì)自帶條件,防止被覆蓋默認(rèn)條件,所以追加一個(gè) AND
            } else {
                $this->init['where_list'] = $where;
            }
            $this->_Member_List();
        }
    
        public function add() {
            $this->_Member_Add();
        }
    
        public function hlist() {
            \Phpcmf\Service::V()->display('form_hlist.html');
        }
    
        //region 回復(fù)內(nèi)容相關(guān)
        public function hufw() {
            $qid = \Phpcmf\Service::L('input')->get('qid');
            $cc = \Phpcmf\Service::M()->db->table(SITE_ID."_form_zixun")->where("id", $qid)->get()->getRowArray();
    
            if(IS_POST){
                $_POST["data"]["title"] = $cc["title"];
                $_POST["data"]["sjlx"] = '1';
                list($tpl) = $this->_Post(0);
            }
    
            \Phpcmf\Service::V()->assign([
                'cc' => $cc,
            ]);
            \Phpcmf\Service::V()->display('form_hf.html');
        }
    
        // 新增回調(diào)函數(shù)
        protected function _Call_Post($data) {
            $cp = parent::_Call_Post($data);
            //自己業(yè)務(wù)處理
    //        exit("222");
            $qid = $data["1"]["hfwtid"];
            $cc = \Phpcmf\Service::M()->db->table(SITE_ID."_form_zixun")->where("id", $qid)->get()->getRowArray();
            //更新關(guān)聯(lián)問題的狀態(tài)為已回復(fù)
            $dataa = array(
                'shifouhuifu' => '1',
            );
            \Phpcmf\Service::M()->db->table('1_form_zixun')->where('id', $qid)->update($dataa);
            $datab = array(
                'uid' => $cc["uid"],
                'author' => $cc["author"],
            );
            \Phpcmf\Service::L('Notice')->send_notice('item_0_2', $datab);
    
            if ($cp['code']) {
                // 這里寫 提交成功時(shí)的 你的程序代碼
                $this->_json($cp['code'], '提交表單成功', $cp['data']);
            } else {
                $this->_json(0, '提交失敗', $cp['data']);
            }
        }
        //endregion
    
        public function edit() {
            $this->_Member_Edit();
        }
    
        public function order_edit() {
            $this->_Member_Order();
        }
    
        public function del() {
            $this->_Member_Del();
        }
    }
    it小民工!
  • <?php namespace Phpcmf\Controllers\Member;
    
    /**
     * 二次開發(fā)時(shí)可以修改本文件,不影響升級(jí)覆蓋
     */
    
    class Zixun extends \Phpcmf\Member\Form
    {
    
        public function index() {
            $where = 'sjlx=0'; // 新的條件組合
            if ($this->init['where_list']) {
                $this->init['where_list'].= ' AND '.$where;
                // 考慮到父類也許有可能會(huì)自帶條件,防止被覆蓋默認(rèn)條件,所以追加一個(gè) AND
            } else {
                $this->init['where_list'] = $where;
            }
            $this->_Member_List();
        }
    
        public function add() {
            $this->_Member_Add();
        }
    
        public function hlist() {
            \Phpcmf\Service::V()->display('form_hlist.html');
        }
    
        //region 回復(fù)內(nèi)容相關(guān)
        public function hufw() {
            $qid = \Phpcmf\Service::L('input')->get('qid');
            $cc = \Phpcmf\Service::M()->db->table(SITE_ID."_form_zixun")->where("id", $qid)->get()->getRowArray();
    
            if(IS_POST){
                $_POST["data"]["title"] = $cc["title"];
                $_POST["data"]["sjlx"] = '1';
                list($tpl) = $this->_Post(0);
            }
    
            \Phpcmf\Service::V()->assign([
                'cc' => $cc,
            ]);
            \Phpcmf\Service::V()->display('form_hf.html');
        }
    
        protected function _Format_Data($id, $data, $old) {
            $cp = parent::_Format_Data($id, $data, $old) ;
            //自己業(yè)務(wù)處理
    //        exit("222");
            $qid = $data["1"]["hfwtid"];
            $cc = \Phpcmf\Service::M()->db->table(SITE_ID."_form_zixun")->where("id", $qid)->get()->getRowArray();
            //更新關(guān)聯(lián)問題的狀態(tài)為已回復(fù)
            $dataa = array(
                'shifouhuifu' => '1',
            );
            \Phpcmf\Service::M()->db->table('1_form_zixun')->where('id', $qid)->update($dataa);
            $datab = array(
                'uid' => $cc["uid"],
                'author' => $cc["author"],
            );
            \Phpcmf\Service::L('Notice')->send_notice('item_0_2', $datab);
    
        }
        //endregion
    
        public function edit() {
            $this->_Member_Edit();
        }
    
        public function order_edit() {
            $this->_Member_Order();
        }
    
        public function del() {
            $this->_Member_Del();
        }
    }
  • 回復(fù)@官方研發(fā)技術(shù)-實(shí)習(xí) 大神,不好意思 剛?cè)プ鲲埩耍以嚵讼?您給我的代碼,確實(shí)可以回調(diào)了,但是有個(gè)問題,發(fā)布表單信息的時(shí)候,點(diǎn)擊按鈕沒提示了,就閃一下,我打開數(shù)據(jù)庫看了下。信息沒保存下來,只是執(zhí)行了回調(diào)的程序,本身提交的信息沒保存下來,我把回調(diào)的注釋了就正常了。

    protected function _Format_Data($id, $data, $old) {
        $cp = parent::_Format_Data($id, $data, $old);

    麻煩您再看下 謝謝了

    it小民工!
  • protected function _Format_Data($id, $data, $old) {
            $cp = parent::_Format_Data($id, $data, $old) ;
            //自己業(yè)務(wù)處理
    //        exit("222");
            $qid = $data["1"]["hfwtid"];
            $cc = \Phpcmf\Service::M()->db->table(SITE_ID."_form_zixun")->where("id", $qid)->get()->getRowArray();
            //更新關(guān)聯(lián)問題的狀態(tài)為已回復(fù)
            $dataa = array(
                'shifouhuifu' => '1',
            );
            \Phpcmf\Service::M()->db->table('1_form_zixun')->where('id', $qid)->update($dataa);
            $datab = array(
                'uid' => $cc["uid"],
                'author' => $cc["author"],
            );
            \Phpcmf\Service::L('Notice')->send_notice('item_0_2', $datab);
            return $cp;
    
        }
    滿意答案
    開源積分+10
    +2元
  • 回復(fù)@官方研發(fā)技術(shù)-實(shí)習(xí) 謝謝官方大神,已經(jīng)OK了,還有個(gè)小問題咨詢您下,我想自定義網(wǎng)站表單提交后的提示文字,如何自定義,求指導(dǎo) 謝謝!

    it小民工!
  • @官方研發(fā)技術(shù)-實(shí)習(xí):完美,多謝官方技術(shù)支持!
    it小民工!
代码语言