請先登入,登入後,確認您的權限後,即可觀看影片。
class\Tad_signup_data.php
store()
tag
//新增資料 public static function store() { /*--略--*/ // 若是超過名額,註記為「候補」 $action = Tad_signup_actions::get($action_id, true); $action['signup'] = Tad_signup_data::get_all($action_id); if (count($action['signup']) >= $action['number']) { $TadDataCenter->set_col('data_id', $id); $TadDataCenter->saveCustomData(['tag' => ['候補']]); } return $id; }
get_all()
//取得所有資料陣列 public static function get_all($action_id = '', $uid = '', $auto_key = false) { /*--略--*/ $data_arr = []; $TadDataCenter = new TadDataCenter('tad_signup'); while ($data = $xoopsDB->fetchArray($result)) { $TadDataCenter->set_col('id', $data['id']); $data['tdc'] = $TadDataCenter->getData(); $data['action'] = Tad_signup_actions::get($data['action_id'], true); $TadDataCenter->set_col('data_id', $data['id']); $data['tag'] = $TadDataCenter->getData('tag', 0); /*--略--*/ } return $data_arr; }
templates\op_tad_signup_actions_show.tpl
<table class="table" data-toggle="table" data-pagination="true" data-search="true" data-mobile-responsive="true"> <!--略--> <tbody> <{foreach from=$signup item=signup_data}> <tr> <!--略--> <td> <{$signup_data.signup_date}> <{if $signup_data.tag}> <div><span class="badge badge-primary"><{$signup_data.tag}></span></div> <{/if}> </td> </tr> <{/foreach}> </tbody> </table>
link to https://github.com/tadlearn/tad_signup/commit/2c6fd30ba620c403a8a5bc8239cbc4efa11b988e \
進階搜尋
18人線上 (3人在瀏覽線上書籍)
會員: 0
訪客: 18