當前位置: 首頁>>代碼示例>>PHP>>正文


PHP B函數代碼示例

本文整理匯總了PHP中B函數的典型用法代碼示例。如果您正苦於以下問題:PHP B函數的具體用法?PHP B怎麽用?PHP B使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了B函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _initialize

 protected function _initialize()
 {
     // 獲取當前用戶ID
     if (defined('UID')) {
         return;
     }
     define('UID', is_login());
     if (!UID) {
         // 還沒登錄 跳轉到登錄頁麵
         $this->redirect('Public/login');
     }
     // js,css的版本
     if (APP_DEBUG) {
         defined('SITE_VERSION') or define('SITE_VERSION', time());
     } else {
         defined('SITE_VERSION') or define('SITE_VERSION', C('SYSTEM_UPDATRE_VERSION'));
     }
     //加載權限控製類
     B('Admin\\Behavior\\AuthCheck');
     //導航
     $top = get_top_menu_name(CONTROLLER_NAME);
     $this->assign('topMenu', $top);
     //菜單
     $this->assign('menus', dynamicMenu($top['id'], $top['pid']));
 }
開發者ID:PunkAvail,項目名稱:ThinkWechat,代碼行數:25,代碼來源:BaseController.class.php

示例2: update

 public function update()
 {
     B('FilterString');
     $data = M(MODULE_NAME)->create();
     $log_info = M(MODULE_NAME)->where("id=" . intval($data['id']))->getField("name");
     //開始驗證有效性
     $this->assign("jumpUrl", u(MODULE_NAME . "/edit", array("id" => $data['id'])));
     if (!check_empty($data['name'])) {
         $this->error(L("ATTR_NAME_EMPTY_TIP"));
     }
     if (!check_empty($data['preset_value']) && $data['input_type'] == 1) {
         $this->error(L("PRESET_VALUE_EMPTY_TIP"));
     }
     // 更新數據
     $list = M(MODULE_NAME)->save($data);
     if (false !== $list) {
         //成功提示
         save_log($log_info . L("UPDATE_SUCCESS"), 1);
         $this->success(L("UPDATE_SUCCESS"));
     } else {
         //錯誤提示
         save_log($log_info . L("UPDATE_FAILED"), 0);
         $this->error(L("UPDATE_FAILED"), 0, $log_info . L("UPDATE_FAILED"));
     }
 }
開發者ID:macall,項目名稱:jsd,代碼行數:25,代碼來源:GoodsTypeAttrAction.class.php

示例3: update

 public function update()
 {
     B('FilterString');
     $data = M(MODULE_NAME)->create();
     $log_info = M(MODULE_NAME)->where("id=" . intval($data['id']))->getField("mail_server");
     //開始驗證有效性
     $this->assign("jumpUrl", u(MODULE_NAME . "/edit", array("id" => $data['id'])));
     if (!check_empty($data['smtp_server'])) {
         $this->error(L("SMTP_SERVER_EMPTY_TIP"));
     }
     if (!check_empty($data['smtp_name'])) {
         $this->error(L("SMTP_NAME_EMPTY_TIP"));
     }
     if (!check_empty($data['smtp_pwd'])) {
         $this->error(L("SMTP_PWD_EMPTY_TIP"));
     }
     // 更新數據
     $list = M(MODULE_NAME)->save($data);
     if (false !== $list) {
         //成功提示
         save_log($log_info . L("UPDATE_SUCCESS"), 1);
         $this->success(L("UPDATE_SUCCESS"));
     } else {
         //錯誤提示
         save_log($log_info . L("UPDATE_FAILED"), 0);
         $this->error(L("UPDATE_FAILED"), 0, $log_info . L("UPDATE_FAILED"));
     }
 }
開發者ID:macall,項目名稱:jsd,代碼行數:28,代碼來源:MailServerAction.class.php

示例4: update

 public function update()
 {
     B('FilterString');
     $data = M(MODULE_NAME)->create();
     $log_info = M(MODULE_NAME)->where("id=" . intval($data['id']))->getField("name");
     //開始驗證有效性
     $this->assign("jumpUrl", u(MODULE_NAME . "/edit", array("id" => $data['id'])));
     if (!check_empty($data['name'])) {
         $this->error(L("VOUCHER_NAME_EMPTY_TIP"));
     }
     if (doubleval($data['money']) <= 0) {
         $this->error(L("VOUCHER_MONEY_ERROR_TIP"));
     }
     $data['begin_time'] = trim($data['begin_time']) == '' ? 0 : to_timespan($data['begin_time']);
     $data['end_time'] = trim($data['end_time']) == '' ? 0 : to_timespan($data['end_time']);
     // 更新數據
     $list = M(MODULE_NAME)->save($data);
     if (false !== $list) {
         //成功提示
         M("Ecv")->where("ecv_type_id=" . $data['id'])->setField("use_limit", $data['use_limit']);
         //同步可用次數
         M("Ecv")->where("ecv_type_id=" . $data['id'])->setField("begin_time", $data['begin_time']);
         M("Ecv")->where("ecv_type_id=" . $data['id'])->setField("end_time", $data['end_time']);
         M("Ecv")->where("ecv_type_id=" . $data['id'])->setField("money", $data['money']);
         save_log($log_info . L("UPDATE_SUCCESS"), 1);
         $this->success(L("UPDATE_SUCCESS"));
     } else {
         //錯誤提示
         save_log($log_info . L("UPDATE_FAILED"), 0);
         $this->error(L("UPDATE_FAILED"), 0, $log_info . L("UPDATE_FAILED"));
     }
 }
開發者ID:eliu03,項目名稱:fanweP2P,代碼行數:32,代碼來源:EcvTypeAction.class.php

示例5: insert

 public function insert()
 {
     B('FilterString');
     $data = M("TagGroup")->create();
     //開始驗證有效性
     $this->assign("jumpUrl", u(MODULE_NAME . "/add"));
     if (!check_empty($data['name'])) {
         $this->error(L("TAGNAME_EMPTY_TIP"));
     }
     // 更新數據
     $log_info = $data['name'];
     $list = M(MODULE_NAME)->add($data);
     if (false !== $list) {
         //成功提示
         foreach ($_REQUEST['cate_id'] as $cate_id) {
             if (intval($cate_id) > 0) {
                 $link_data = array();
                 $link_data['category_id'] = intval($cate_id);
                 $link_data['tag_group_id'] = $list;
                 M("TagGroupLink")->add($link_data);
             }
         }
         clear_auto_cache("store_filter_nav_cache");
         save_log($log_info . L("INSERT_SUCCESS"), 1);
         $this->success(L("INSERT_SUCCESS"));
     } else {
         //錯誤提示
         save_log($log_info . L("INSERT_FAILED"), 0);
         $this->error(L("INSERT_FAILED"));
     }
 }
開發者ID:dalinhuang,項目名稱:zsh_business,代碼行數:31,代碼來源:TagGroupAction.class.php

示例6: update

 public function update()
 {
     B('FilterString');
     $data = M(MODULE_NAME)->create();
     $log_info = $data['id'] . l("TOPIC_DATA");
     //開始驗證有效性
     $this->assign("jumpUrl", u(MODULE_NAME . "/edit", array("id" => $data['id'])));
     // 更新數據
     $list = M(MODULE_NAME)->save($data);
     if (false !== $list) {
         rm_auto_cache("recommend_forum_topic");
         M("TopicCateLink")->where("topic_id=" . $data['id'])->delete();
         foreach ($_REQUEST['cate_id'] as $cate_id) {
             $link_data = array();
             $link_data['cate_id'] = $cate_id;
             $link_data['topic_id'] = $data['id'];
             M("TopicCateLink")->add($link_data);
         }
         syn_topic_match($data['id']);
         //成功提示
         save_log($log_info . L("UPDATE_SUCCESS"), 1);
         $this->success(L("UPDATE_SUCCESS"));
     } else {
         //錯誤提示
         save_log($log_info . L("UPDATE_FAILED"), 0);
         $this->error(L("UPDATE_FAILED"), 0, $log_info . L("UPDATE_FAILED"));
     }
 }
開發者ID:macall,項目名稱:jsd,代碼行數:28,代碼來源:TopicAction.class.php

示例7: update

 public function update()
 {
     B('FilterString');
     $data = M("ApnsMessages")->create();
     $log_info = $data['id'];
     //開始驗證有效性
     $this->assign("jumpUrl", u("MApns/edit", array("id" => $data['id'])));
     if (!check_empty($data['content'])) {
         $this->error(L("CONTENT_EMPTY_TIP"));
     }
     if ($data['send_time'] == '') {
         $data['send_time'] = get_gmtime();
     }
     $data['send_time'] = to_timespan($data['send_time']);
     if (intval($_REQUEST['resend']) == 1) {
         $data['status'] = 0;
     }
     $list = M("ApnsMessages")->save($data);
     if (false !== $list) {
         //成功提示
         save_log($log_info . L("UPDATE_SUCCESS"), 1);
         $this->success(L("UPDATE_SUCCESS"));
     } else {
         //錯誤提示
         save_log($log_info . L("UPDATE_FAILED"), 0);
         $this->error(L("UPDATE_FAILED"), 0, $log_info . L("UPDATE_FAILED"));
     }
 }
開發者ID:dalinhuang,項目名稱:zsh_business,代碼行數:28,代碼來源:MApnsAction.class.php

示例8: update

 public function update()
 {
     B('FilterString');
     $data = M(MODULE_NAME)->create();
     $log_info = M(MODULE_NAME)->where("id=" . intval($data['id']))->getField("name");
     //開始驗證有效性
     $this->assign("jumpUrl", u(MODULE_NAME . "/edit", array("id" => $data['id'])));
     if (!check_empty($data['name'])) {
         $this->error(L("USER_GROUP_NAME_EMPTY_TIP"));
     }
     if ($data['discount'] <= 0 || $data['discount'] > 1) {
         $data['discount'] = 1;
     }
     // 更新數據
     $list = M(MODULE_NAME)->save($data);
     if (false !== $list) {
         //成功提示
         save_log($log_info . L("UPDATE_SUCCESS"), 1);
         $this->success(L("UPDATE_SUCCESS"));
     } else {
         //錯誤提示
         $dbErr = M()->getDbError();
         save_log($log_info . L("UPDATE_FAILED") . $dbErr, 0);
         $this->error(L("UPDATE_FAILED") . $dbErr);
     }
 }
開發者ID:macall,項目名稱:jsd,代碼行數:26,代碼來源:UserGroupAction.class.php

示例9: insert

 public function insert()
 {
     B('FilterString');
     $data = M("PointGroup")->create();
     //開始驗證有效性
     $this->assign("jumpUrl", u(MODULE_NAME . "/add"));
     if (!check_empty($data['name'])) {
         $this->error(L("POINTNAME_EMPTY_TIP"));
     }
     if (M(MODULE_NAME)->where("`name`='" . $data['name'] . "'")->count() > 0) {
         $this->error(L("HAD_POINTGROUP"));
     }
     // 更新數據
     $log_info = $data['name'];
     $list = M(MODULE_NAME)->add($data);
     if (false !== $list) {
         //成功提示
         save_log($log_info . L("INSERT_SUCCESS"), 1);
         $this->success(L("INSERT_SUCCESS"));
     } else {
         //錯誤提示
         save_log($log_info . L("INSERT_FAILED"), 0);
         $this->error(L("INSERT_FAILED"));
     }
 }
開發者ID:dalinhuang,項目名稱:zsh_business,代碼行數:25,代碼來源:PointGroupAction.class.php

示例10: update

 public function update()
 {
     B('FilterString');
     $data = M(MODULE_NAME)->create();
     $user_names = preg_split("/[ ,]/i", $data['user_names']);
     $user_ids = "";
     foreach ($user_names as $k => $v) {
         $uid = M("User")->where("user_name = '" . $v . "'")->getField("id");
         if ($uid) {
             $user_ids .= $uid . "|";
         }
     }
     $data['user_ids'] = $user_ids;
     $data['end_time'] = trim($data['end_time']) == '' ? 0 : to_timespan($data['end_time']);
     $log_info = M(MODULE_NAME)->where("id=" . intval($data['id']))->getField("title");
     //開始驗證有效性
     $this->assign("jumpUrl", u(MODULE_NAME . "/edit", array("id" => $data['id'])));
     if (!check_empty($data['title'])) {
         $this->error(L("MSY_TITLE_EMPTY_TIP"));
     }
     if (!check_empty($data['content'])) {
         $this->error(L("MSY_CONTENT_EMPTY_TIP"));
     }
     // 更新數據
     $list = M(MODULE_NAME)->save($data);
     if (false !== $list) {
         //成功提示
         save_log($log_info . L("UPDATE_SUCCESS"), 1);
         $this->success(L("UPDATE_SUCCESS"));
     } else {
         //錯誤提示
         save_log($log_info . L("UPDATE_FAILED"), 0);
         $this->error(L("UPDATE_FAILED"), 0, $log_info . L("UPDATE_FAILED"));
     }
 }
開發者ID:dalinhuang,項目名稱:zsh_business,代碼行數:35,代碼來源:MsgSystemAction.class.php

示例11: insert

 public function insert()
 {
     B('FilterString');
     $ajax = intval($_REQUEST['ajax']);
     $data = M(MODULE_NAME)->create();
     //開始驗證有效性
     $this->assign("jumpUrl", u(MODULE_NAME . "/add"));
     if (!check_empty($data['name'])) {
         $this->error("請輸入分類名稱");
     }
     $user_level_list = M(MODULE_NAME)->where("point=" . intval($data['point']))->find();
     if ($user_level_list) {
         $this->error('已有相同的"所需信用值"');
     }
     // 更新數據
     $log_info = $data['name'];
     $list = M(MODULE_NAME)->add($data);
     if (false !== $list) {
         //成功提示
         save_log($log_info . L("INSERT_SUCCESS"), 1);
         $this->success(L("INSERT_SUCCESS"));
     } else {
         //錯誤提示
         save_log($log_info . L("INSERT_FAILED"), 0);
         $this->error(L("INSERT_FAILED"));
     }
 }
開發者ID:myjavawork,項目名稱:sanxin-fangwei,代碼行數:27,代碼來源:UserLevelAction.class.php

示例12: update

 public function update()
 {
     B('FilterString');
     $data = M(MODULE_NAME)->create();
     $log_info = M(MODULE_NAME)->where("id=" . intval($data['id']))->getField("name");
     //開始驗證有效性
     $this->assign("jumpUrl", u(MODULE_NAME . "/edit", array("id" => $data['id'])));
     if (!check_empty($data['name'])) {
         $this->error(L("BRAND_NAME_EMPTY_TIP"));
     }
     $data['begin_time'] = trim($data['begin_time']) == '' ? 0 : to_timespan($data['begin_time']);
     $data['end_time'] = trim($data['end_time']) == '' ? 0 : to_timespan($data['end_time']);
     // 更新數據
     $list = M(MODULE_NAME)->save($data);
     if (false !== $list) {
         //同步更新所有的產品
         M("Deal")->where("brand_id=" . $data['id'] . " and brand_promote = 1")->setField("begin_time", $data['begin_time']);
         M("Deal")->where("brand_id=" . $data['id'] . " and brand_promote = 1")->setField("end_time", $data['end_time']);
         //成功提示
         syn_brand_status($data['id']);
         clear_auto_cache("static_goods_info");
         save_log($log_info . L("UPDATE_SUCCESS"), 1);
         $this->success(L("UPDATE_SUCCESS"));
     } else {
         //錯誤提示
         save_log($log_info . L("UPDATE_FAILED"), 0);
         $this->error(L("UPDATE_FAILED"), 0, $log_info . L("UPDATE_FAILED"));
     }
 }
開發者ID:dalinhuang,項目名稱:zsh_business,代碼行數:29,代碼來源:BrandAction.class.php

示例13: run

 public function run(&$params)
 {
     $ccmService = service('CouponCodeMall');
     $ccmService->clearCache($params['id']);
     $params = null;
     B('CouponCodeMallRecs', $params);
 }
開發者ID:yunsite,項目名稱:tp-coupon,代碼行數:7,代碼來源:CouponCodeMallBehavior.class.php

示例14: _initialize

 public function _initialize()
 {
     $action = array('permission' => array(), 'allow' => array('changecontent', 'listdialog', 'revert', 'adddialog', 'analytics', 'checkout', 'getmonthlyreceive', 'getyearreceivecomparison', 'getreceivablesmoney', 'getpayablesmoney'));
     B('Authenticate', $action);
     $this->type = trim($_GET['t']) ? trim($_GET['t']) : 'receivables';
     if (!in_array($this->type, array('receivables', 'payables', 'receivingorder', 'paymentorder'))) {
         alert('error', L('PARAMETER_ERROR'), U('index/index'));
     }
 }
開發者ID:strollClouds,項目名稱:snkStudy,代碼行數:9,代碼來源:FinanceAction.class.php

示例15: _initialize

 public function _initialize()
 {
     $action = array();
     B('Admin\\Behaviors\\Authenticate', '', $action);
     //獲取欄目信息
     if (!($this->categorys = F('category_content'))) {
         D('ArticleCategory')->file_cache();
         $this->categorys = F('category_content');
     }
 }
開發者ID:shenyangchong,項目名稱:bjui_php,代碼行數:10,代碼來源:ArticleController.class.php


注:本文中的B函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。