当前位置: 首页>>代码示例>>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;未经允许,请勿转载。