迅睿開源框架是一款PHP8高性能·簡單易用的PHP開源開發(fā)框架, 基于MIT開源許可協(xié)議發(fā)布,不限制商業(yè)使用,以多端互聯(lián)為設(shè)計理念, 支持的微信公眾號、小程序、APP客戶端、移動端網(wǎng)站、PC網(wǎng)站等多終端式管理系統(tǒng)。
業(yè)務經(jīng)理
微信掃描以上二維碼
028-61286886
技術(shù)咨詢
我想在用戶自定義表單內(nèi)容里顯示附件鏈接
{php $data = \Phpcmf\Service::C()->get_attachment(附件id);} {$data.filename}
關(guān)鍵是怎么拿到附件ID?或者哪位高手能幫我看看,謝謝,直接寫ID是用戶id,娶不到附件ID
這個是上傳字段獲取的文件ID號,比如你后臺上傳字段叫什么,在哪個模板調(diào)用
開源是一種精神,但不是義務,幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復迅??蚣軇?chuàng)始人
我知道,我是在TPLPATH/pc/default/member/form_list.html 這個模板里調(diào)用,這個ID值我怎么傳進去?
這個是前端用戶中心的表單列表頁面,你把這個form_html完整的標簽發(fā)上來,
其次,在截圖一下后臺自定義字段的樣子,我看看類型截圖和名字截圖
圖二的字段,哪個是上傳文件的字段?
回復@風清揚
圖一部分不截圖,發(fā)代碼,方便我修改
<form class="form-horizontal" role="form" id="myform">
{dr_form_hidden()}
<div class="table-scrollable">
<table class="table table-striped table-bordered table-hover table-checkable dataTable">
<thead>
<tr class="heading">
{if $is_delete}
<th class="myselect">
<label class="mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
<input type="checkbox" class="group-checkable" data-set=".checkboxes" />
<span></span>
</label>
</th>
{/if}
<th style="text-align:center" width="70" class="{dr_sorting('displayorder')}" name="displayorder">排序</th>
<th class="{dr_sorting('title')}" name="title">項目名稱</th>
<th class="{dr_sorting('xmlb')}" name="xmlb">項目類型</th>
<th class="{dr_sorting('xmlb')}" name="xmlb">項目申報書附件</th>
<th style="text-align:center" width="70" class="{dr_sorting('status')}" name="status">狀態(tài)</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{loop $list $t}
<tr class="odd gradeX" id="dr_row_{$t.id}">
<td class="myselect">
<input type="checkbox" class="checkboxes" name="ids[]" value="{$t.id}" />
</td>
<td style="text-align:center"> <input type="text" onblur="dr_ajax_save(this.value, '{dr_member_url($uriprefix.'/order_edit', ['id'=>$t.id, 'cid' => $t.cid])}')" value="{$t.displayorder}" class="displayorder form-control input-sm input-inline input-mini"> </td>
<td>{dr_list_function('title', $t['title'], $param, $t)}</td>
<td>{dr_list_function('xblb', $t['xmlb'], $param, $t)}</td>
<td><a href="{php $data = \Phpcmf\Service::C()->get_attachment($t.id);}{dr_down_file($t.id)}">{php $data = \Phpcmf\Service::C()->get_attachment($t.id);}
{$data.filename}</a></td>
<td style="text-align:center">{Function_list::status($t.status)}</td>
<td>
{if $t.status==2}
<label><a href="{dr_member_url($uriprefix.'/edit', ['id'=>$t.id, 'cid'=>$t.cid])}" class="btn btn-xs red"> <i class="fa fa-edit"></i> {dr_lang('修改')}</a></label>
<label><a href="{Router::form_show_url($form_table, $t.id)}" target="_blank" class="btn btn-xs dark"> <i class="fa fa-search"></i> {dr_lang('查看')}</a></label>
{if $t.status==2}<label style="color:red">拒絕原因:{$t.neirong} </label>{/if}
{/loop}
</tbody>
</table>
</div>
<div class="row fc-list-footer table-checkable ">
<div class="col-md-5 fc-list-select">
<label><button type="button" onclick="dr_ajax_option('{dr_member_url($uriprefix.'/del')}', '你確定要刪除嗎?', 1)" class="btn red btn-sm"> <i class="fa fa-trash"></i> 刪除</button></label>
<div class="col-md-7 fc-list-page">
{$mypages}
</form>
回復迅??蚣軇?chuàng)始人 附件上傳到的表和自定義的表單的表不是一個,自定義的表名是 dr_1_form_sbxt 這個表,附件在 這個表里dr_attachment_data,兩個表示通過UID關(guān)聯(lián)的
可能你理解錯了我的意思,你那截圖下后臺表單發(fā)布界面
我就想要這個界面的完整截圖
我問東,你在答西,始終等不到你的正確回答
著實辛苦創(chuàng)始人大哥了,我看著都心急 ?? ??
創(chuàng)始人不愧為老師,這才是教師精神,換著是我來回答這么多問題,我必然會煩
據(jù)我觀察,我感覺是這個字段是文件上傳字段
不知道樓主定義的是不是這個,還是要看發(fā)布界面的截圖
?? ?? 還沒發(fā)出來么,真著急啊
回復迅睿框架創(chuàng)始人 昨天不讓我再發(fā)了,晚上家里有點事,非常感謝您的盡心盡責!
我要的就是這個,,這個是單文件字段,他的英文名字叫什么,
dr_attachment_data表里 字段名是:attachment
回復迅睿框架創(chuàng)始人
我覺得你又在亂回答了,我是讓你給我這個字段的英文名稱,跟這個表dr_attachment_data一點關(guān)系都沒有啊,注意題干?。?/span>
這個圖片的字段在,設(shè)置-表單管理-自定義字段-列表里面就可以看到英文名稱啊
回復迅睿框架創(chuàng)始人 attachment
我不信,你截圖下這個界面
回復迅睿框架創(chuàng)始人 要的是這個呀 ,暈沒理解,sbbsc
我被你快要氣暈過去了,真正的名字叫sbbsc,哪里叫attachment,你提供的信息都是錯的,本來幾秒鐘可以給你寫出來的代碼,折騰一大圈
<td><a target="_blank" href="{dr_down_file($t.sbbsc)}">{php $data = \Phpcmf\Service::C()->get_attachment($t.sbbsc);} {$data.filename}</a></td>
還是12樓的哥們有遠見,你要感謝下12樓
創(chuàng)始人熱心到了極點,不買授權(quán)對不起你啊
這個是上傳字段獲取的文件ID號,比如你后臺上傳字段叫什么,在哪個模板調(diào)用
開源是一種精神,但不是義務,幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復迅??蚣軇?chuàng)始人
我知道,我是在TPLPATH/pc/default/member/form_list.html 這個模板里調(diào)用,這個ID值我怎么傳進去?
這個是前端用戶中心的表單列表頁面,你把這個form_html完整的標簽發(fā)上來,
其次,在截圖一下后臺自定義字段的樣子,我看看類型截圖和名字截圖
開源是一種精神,但不是義務,幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復迅??蚣軇?chuàng)始人
圖二的字段,哪個是上傳文件的字段?
回復@風清揚
開源是一種精神,但不是義務,幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
圖一部分不截圖,發(fā)代碼,方便我修改
圖二的字段,哪個是上傳文件的字段?
開源是一種精神,但不是義務,幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復迅??蚣軇?chuàng)始人
<form class="form-horizontal" role="form" id="myform">
{dr_form_hidden()}
<div class="table-scrollable">
<table class="table table-striped table-bordered table-hover table-checkable dataTable">
<thead>
<tr class="heading">
{if $is_delete}
<th class="myselect">
<label class="mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
<input type="checkbox" class="group-checkable" data-set=".checkboxes" />
<span></span>
</label>
</th>
{/if}
<th style="text-align:center" width="70" class="{dr_sorting('displayorder')}" name="displayorder">排序</th>
<th class="{dr_sorting('title')}" name="title">項目名稱</th>
<th class="{dr_sorting('xmlb')}" name="xmlb">項目類型</th>
<th class="{dr_sorting('xmlb')}" name="xmlb">項目申報書附件</th>
<th style="text-align:center" width="70" class="{dr_sorting('status')}" name="status">狀態(tài)</th>
<th>操作</th>
</tr>
</thead>
<tbody>
{loop $list $t}
<tr class="odd gradeX" id="dr_row_{$t.id}">
{if $is_delete}
<td class="myselect">
<label class="mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
<input type="checkbox" class="checkboxes" name="ids[]" value="{$t.id}" />
<span></span>
</label>
</td>
{/if}
<td style="text-align:center"> <input type="text" onblur="dr_ajax_save(this.value, '{dr_member_url($uriprefix.'/order_edit', ['id'=>$t.id, 'cid' => $t.cid])}')" value="{$t.displayorder}" class="displayorder form-control input-sm input-inline input-mini"> </td>
<td>{dr_list_function('title', $t['title'], $param, $t)}</td>
<td>{dr_list_function('xblb', $t['xmlb'], $param, $t)}</td>
<td><a href="{php $data = \Phpcmf\Service::C()->get_attachment($t.id);}{dr_down_file($t.id)}">{php $data = \Phpcmf\Service::C()->get_attachment($t.id);}
{$data.filename}</a></td>
<td style="text-align:center">{Function_list::status($t.status)}</td>
<td>
{if $t.status==2}
<label><a href="{dr_member_url($uriprefix.'/edit', ['id'=>$t.id, 'cid'=>$t.cid])}" class="btn btn-xs red"> <i class="fa fa-edit"></i> {dr_lang('修改')}</a></label>
{/if}
<label><a href="{Router::form_show_url($form_table, $t.id)}" target="_blank" class="btn btn-xs dark"> <i class="fa fa-search"></i> {dr_lang('查看')}</a></label>
{if $t.status==2}<label style="color:red">拒絕原因:{$t.neirong} </label>{/if}
</td>
</tr>
{/loop}
</tbody>
</table>
</div>
<div class="row fc-list-footer table-checkable ">
<div class="col-md-5 fc-list-select">
{if $is_delete}
<label class="mt-table mt-checkbox mt-checkbox-single mt-checkbox-outline">
<input type="checkbox" class="group-checkable" data-set=".checkboxes" />
<span></span>
</label>
<label><button type="button" onclick="dr_ajax_option('{dr_member_url($uriprefix.'/del')}', '你確定要刪除嗎?', 1)" class="btn red btn-sm"> <i class="fa fa-trash"></i> 刪除</button></label>
{/if}
</div>
<div class="col-md-7 fc-list-page">
{$mypages}
</div>
</div>
</form>
回復迅??蚣軇?chuàng)始人 附件上傳到的表和自定義的表單的表不是一個,自定義的表名是 dr_1_form_sbxt 這個表,附件在 這個表里dr_attachment_data,兩個表示通過UID關(guān)聯(lián)的
可能你理解錯了我的意思,你那截圖下后臺表單發(fā)布界面
開源是一種精神,但不是義務,幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
我就想要這個界面的完整截圖
我問東,你在答西,始終等不到你的正確回答
開源是一種精神,但不是義務,幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
著實辛苦創(chuàng)始人大哥了,我看著都心急 ?? ??
創(chuàng)始人不愧為老師,這才是教師精神,換著是我來回答這么多問題,我必然會煩
據(jù)我觀察,我感覺是這個字段是文件上傳字段
不知道樓主定義的是不是這個,還是要看發(fā)布界面的截圖
?? ?? 還沒發(fā)出來么,真著急啊
開源是一種精神,但不是義務,幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復迅睿框架創(chuàng)始人 昨天不讓我再發(fā)了,晚上家里有點事,非常感謝您的盡心盡責!
我要的就是這個,

,這個是單文件字段,他的英文名字叫什么,
開源是一種精神,但不是義務,幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
dr_attachment_data表里 字段名是:attachment
回復迅睿框架創(chuàng)始人
我覺得你又在亂回答了,我是讓你給我這個字段的英文名稱,跟這個表dr_attachment_data一點關(guān)系都沒有啊,注意題干?。?/span>
這個圖片的字段在,設(shè)置-表單管理-自定義字段-列表里面就可以看到英文名稱啊
回復@風清揚
開源是一種精神,但不是義務,幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復迅睿框架創(chuàng)始人 attachment
我不信,你截圖下這個界面
回復@風清揚
開源是一種精神,但不是義務,幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
回復迅睿框架創(chuàng)始人 要的是這個呀 ,暈沒理解,sbbsc

我被你快要氣暈過去了,真正的名字叫sbbsc,哪里叫attachment,你提供的信息都是錯的,本來幾秒鐘可以給你寫出來的代碼,折騰一大圈
<td><a target="_blank" href="{dr_down_file($t.sbbsc)}">{php $data = \Phpcmf\Service::C()->get_attachment($t.sbbsc);} {$data.filename}</a></td>還是12樓的哥們有遠見,你要感謝下12樓
開源是一種精神,但不是義務,幫忙是情分,不幫也不要抱怨,建議大家多研究代碼、多閱讀代碼、多翻閱社區(qū)歷史問題!
創(chuàng)始人熱心到了極點,不買授權(quán)對不起你啊