迅睿開源框架是一款PHP8高性能·簡單易用的PHP開源開發(fā)框架, 基于MIT開源許可協(xié)議發(fā)布,不限制商業(yè)使用,以多端互聯(lián)為設(shè)計(jì)理念, 支持的微信公眾號、小程序、APP客戶端、移動(dòng)端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
業(yè)務(wù)經(jīng)理
微信掃描以上二維碼
028-61286886
技術(shù)咨詢
模塊表單添加內(nèi)容時(shí)候修改錄入作者賬號,按照模塊主信息,可以修改掉uid。但是模塊表單僅僅是修改掉author字段,uid字段沒有被更新。
建議可以同步修改。 這樣表單應(yīng)用可以更靈活。
D_Admin_Form.php
if (IS_POST) { // 設(shè)置uid便于校驗(yàn)處理 $uid = $this->input->post('data[author]') ? get_member_id($this->input->post('data[author]')) : 0; $post = $this->validate_filter($this->field, $data); if (isset($post['error'])) { $error = $post; $data = $this->input->post('data', TRUE); } else { $post[1]['cid'] = $post[0]['cid'] = $this->cid; $post[1]['uid'] = $post[0]['uid'] = $uid; $post[1]['url'] = $this->cdata['url']; $post[1]['title'] = $this->cdata['title']; $post[1]['subject'] = $this->cdata['title']; $post[1]['inputip'] = $this->input->ip_address(); $post[1]['inputtime'] = SYS_TIME; $table = SITE_ID.'_'.APP_DIR.'_form_'.$this->fid; if ($id = $this->_add($table, $post)) { // 操作成功處理附件 $this->attachment_handle($this->uid, $this->db->dbprefix($this->table).'-'.$id, $this->form['field']); $this->admin_msg(fc_lang('操作成功,正在刷新...'), dr_url(APP_DIR.'/'.$this->router->class.'/index', array('cid' => $this->cid)), 1); } else { $this->admin_msg(fc_lang('操作失敗')); } }
$uid = $this->input->post('data[author]') ? get_member_id($this->input->post('data[author]')) : 0; 增加關(guān)聯(lián)查詢。
$post[1]['uid'] = $post[0]['uid'] = $uid; 修改為查詢得到的UID。
冒失修改表單相應(yīng)錄入者和UID也存在問題。
畢竟后臺還需要靈活,前臺則無需。
D_Admin_Form.php
if (IS_POST) { // 設(shè)置uid便于校驗(yàn)處理 $uid = $this->input->post('data[author]') ? get_member_id($this->input->post('data[author]')) : 0; $post = $this->validate_filter($this->field, $data); if (isset($post['error'])) { $error = $post; $data = $this->input->post('data', TRUE); } else { $post[1]['cid'] = $post[0]['cid'] = $this->cid; $post[1]['uid'] = $post[0]['uid'] = $uid; $post[1]['url'] = $this->cdata['url']; $post[1]['title'] = $this->cdata['title']; $post[1]['subject'] = $this->cdata['title']; $post[1]['inputip'] = $this->input->ip_address(); $post[1]['inputtime'] = SYS_TIME; $table = SITE_ID.'_'.APP_DIR.'_form_'.$this->fid; if ($id = $this->_add($table, $post)) { // 操作成功處理附件 $this->attachment_handle($this->uid, $this->db->dbprefix($this->table).'-'.$id, $this->form['field']); $this->admin_msg(fc_lang('操作成功,正在刷新...'), dr_url(APP_DIR.'/'.$this->router->class.'/index', array('cid' => $this->cid)), 1); } else { $this->admin_msg(fc_lang('操作失敗')); } }$uid = $this->input->post('data[author]') ? get_member_id($this->input->post('data[author]')) : 0; 增加關(guān)聯(lián)查詢。
$post[1]['uid'] = $post[0]['uid'] = $uid; 修改為查詢得到的UID。
冒失修改表單相應(yīng)錄入者和UID也存在問題。
畢竟后臺還需要靈活,前臺則無需。