业务经理
微信扫描以上二维码
028-61286886
PHP程序里面
各位大神,求助下,关于网站表单发布后的回调,前端发布回调,参考:/doc/897.html 写回调, 没问题,但是如果我是在网站会员中心发布的网站表单,就不能回调了,也就是这个地址发布的可以回调:http://ooxx.com/index.php?s=form&c=zixun&m=post 但是这个地址发布的不能回调http://ooxx.com/index.php?s=member&app=form&c=zixun&m=add。求助了下老大,老大说会员中心的网站表单发布没有写回调方法,只能在这边求助下大神们,我需要在会员中心网站表单发布后,调用回调完成另外一个表的更新和消息的发送。有什么方法可以做到,谢谢了!
// 新增回调函数 protected function _Call_Post($data) { $cp = parent::_Call_Post($data); if ($cp['code']) { // 这里写 提交成功时的 你的程序代码 $this->_json($cp['code'], '提交表单成功', $cp['data']); } else { $this->_json(0, '提交失败', $cp['data']); } }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'); } // 新增回调函数 protected function _Call_Post($data) { $cp = parent::_Call_Post($data); //自己业务处理 // exit("222"); $qid = $data["1"]["hfwtid"]; $cc = \Phpcmf\Service::M()->db->table(SITE_ID."_form_zixun")->where("id", $qid)->get()->getRowArray(); //更新关联问题的状态为已回复 $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']) { // 这里写 提交成功时的 你的程序代码 $this->_json($cp['code'], '提交表单成功', $cp['data']); } else { $this->_json(0, '提交失败', $cp['data']); } }init['where_list']) { $this->init['where_list'].= ' AND '.$where; // 考虑到父类也许有可能会自带条件,防止被覆盖默认条件,所以追加一个 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 回复内容相关 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 _Call_Post($data) { $cp = parent::_Call_Post($data); //自己业务处理 // exit("222"); $qid = $data["1"]["hfwtid"]; $cc = \Phpcmf\Service::M()->db->table(SITE_ID."_form_zixun")->where("id", $qid)->get()->getRowArray(); //更新关联问题的状态为已回复 $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']) { // 这里写 提交成功时的 你的程序代码 $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(); } }init['where_list']) { $this->init['where_list'].= ' AND '.$where; // 考虑到父类也许有可能会自带条件,防止被覆盖默认条件,所以追加一个 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 回复内容相关 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) ; //自己业务处理 // exit("222"); $qid = $data["1"]["hfwtid"]; $cc = \Phpcmf\Service::M()->db->table(SITE_ID."_form_zixun")->where("id", $qid)->get()->getRowArray(); //更新关联问题的状态为已回复 $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(); } }protected function _Format_Data($id, $data, $old) { $cp = parent::_Format_Data($id, $data, $old);麻烦您再看下 谢谢了protected function _Format_Data($id, $data, $old) { $cp = parent::_Format_Data($id, $data, $old) ; //自己业务处理 // exit("222"); $qid = $data["1"]["hfwtid"]; $cc = \Phpcmf\Service::M()->db->table(SITE_ID."_form_zixun")->where("id", $qid)->get()->getRowArray(); //更新关联问题的状态为已回复 $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; }