当前位置: 首页>>代码示例>>PHP>>正文


PHP Validate::isNullStr方法代码示例

本文整理汇总了PHP中Validate::isNullStr方法的典型用法代码示例。如果您正苦于以下问题:PHP Validate::isNullStr方法的具体用法?PHP Validate::isNullStr怎么用?PHP Validate::isNullStr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Validate的用法示例。


在下文中一共展示了Validate::isNullStr方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: checkAdd

 public function checkAdd(&$model, array $param)
 {
     if (Validate::isNullStr($_POST['name'])) {
         $this->message[] = '物流公司名称不得为空';
         $this->flag = false;
     }
     if (Validate::isNullStr($_POST['url'])) {
         $this->message[] = '物流公司网址不得为空';
         $this->flag = false;
     }
     if (Validate::checkStrLength($_POST['url'], 40, 'max')) {
         $this->message[] = '品牌网址不得大于40位';
         $this->flag = false;
     }
     if (!Validate::isNumeric($_POST['price_in'])) {
         $this->message[] = '省内起步费用必须为数字';
         $this->flag = false;
     }
     if (!Validate::isNumeric($_POST['price_out'])) {
         $this->message[] = '省外起步费用必须为数字';
         $this->flag = false;
     }
     if (!Validate::isNumeric($_POST['price_add'])) {
         $this->message[] = '额外费用必须为数字';
         $this->flag = false;
     }
     if ($model->isOne($param)) {
         $this->message[] = '该物流公司已被占用';
         $this->flag = false;
     }
     return $this->flag;
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:32,代码来源:DeliveryCheck.class.php

示例2: isShow

 public function isShow()
 {
     if (!Validate::isNullStr($this->R['id']) && !Validate::isNullStr($this->R['act'])) {
         if ($this->R['act'] == 'yes') {
             return parent::update(array("id='{$this->R['id']}'"), array('state' => '1'));
         } elseif ($this->R['act'] == 'no') {
             return parent::update(array("id='{$this->R['id']}'"), array('state' => '0'));
         }
     }
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:10,代码来源:RotatorModel.class.php

示例3: checkAdd

 public function checkAdd(&$model, array $param)
 {
     if (Validate::isNullStr($_POST['name'])) {
         $this->message[] = '商品名不得为空';
         $this->flag = false;
     }
     if (Validate::isNullStr($_POST['nav'])) {
         $this->message[] = '种类不得为空';
         $this->flag = false;
     }
     if (Validate::isNullStr($_POST['sn'])) {
         $this->message[] = '编号不得为空';
         $this->flag = false;
     }
     if (!Validate::isNumeric($_POST['weight'])) {
         $this->message[] = '商品重量必须为数字';
         $this->flag = false;
     }
     if (!Validate::isNumeric($_POST['price_sale'])) {
         $this->message[] = '商品销售价必须为数字';
         $this->flag = false;
     }
     if (!Validate::isNumeric($_POST['price_market'])) {
         $this->message[] = '商品成本价必须为数字';
         $this->flag = false;
     }
     if (!Validate::isNumeric($_POST['price_cost'])) {
         $this->message[] = '商品成本价必须为数字';
         $this->flag = false;
     }
     if (!Validate::isNumeric($_POST['inventory'])) {
         $this->message[] = '库存必须为数字';
         $this->flag = false;
     }
     if (!Validate::isNumeric($_POST['warn_inventory'])) {
         $this->message[] = '库存告急必须为数字';
         $this->flag = false;
     }
     if (Validate::checkStrLength($_POST['name'], 20, 'max')) {
         $this->message[] = '商品名不得大于20位';
         $this->flag = false;
     }
     if ($model->isOne($param)) {
         $this->message[] = '商品已被占用';
         $this->flag = false;
     }
     return $this->flag;
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:48,代码来源:GoodsCheck.class.php

示例4: checkUpdate

 public function checkUpdate(&$model)
 {
     if (Validate::isNullStr($_POST['link'])) {
         $this->message[] = '链接地址不得为空';
         $this->flag = false;
     }
     if (Validate::isNullStr($_POST['thumb'])) {
         $this->message[] = '图片地址不得为空';
         $this->flag = false;
     }
     if (Validate::checkStrLength($_POST['link'], 40, 'max')) {
         $this->message[] = '链接地址不得大于50位';
         $this->flag = false;
     }
     return $this->flag;
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:16,代码来源:RotatorCheck.class.php

示例5: checkAdd

 public function checkAdd(&$model, array $param)
 {
     if (Validate::isNullStr($_POST['content'])) {
         $this->message[] = '评论内容不得为空';
         $this->flag = false;
     }
     if (Validate::checkStrLength($_POST['content'], 200, 'max')) {
         $this->message[] = '评论内容不得大于200字';
         $this->flag = false;
     }
     if ($model->isOne($param)) {
         $this->message[] = '一个订单只能评论一次';
         $this->flag = false;
     }
     return $this->flag;
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:16,代码来源:CommendCheck.class.php

示例6: checkUpdate

 public function checkUpdate(&$model)
 {
     if (Validate::checkStrLength($_POST['pwd'], 6, 'min')) {
         $this->message[] = '密码不得小于6位';
         $this->flag = false;
     }
     if (Validate::isNullStr($_POST['pwd'])) {
         $this->message[] = '密码不得为空';
         $this->flag = false;
     }
     if (!Validate::checkStrEquals($_POST['pwd'], $_POST['notpwd'])) {
         $this->message[] = '密码和确认码必须一致';
         $this->flag = false;
     }
     if (Validate::isNullStr($_POST['level'])) {
         $this->message[] = '管理员等级不得为空';
         $this->flag = false;
     }
     return $this->flag;
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:20,代码来源:ManageCheck.class.php

示例7: checkUpdate

 public function checkUpdate(&$model)
 {
     if (Validate::isNullStr($_POST['url'])) {
         $this->message[] = '品牌网址不得为空';
         $this->flag = false;
     }
     if (Validate::isNullStr($_POST['type'])) {
         $this->message[] = '品牌类型不得为空';
         $this->flag = false;
     }
     if (Validate::checkStrLength($_POST['info'], 200, 'max')) {
         $this->message[] = '品牌简介不得大于20位';
         $this->flag = false;
     }
     if (Validate::checkStrLength($_POST['url'], 40, 'max')) {
         $this->message[] = '品牌网址不得大于20位';
         $this->flag = false;
     }
     return $this->flag;
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:20,代码来源:BrandCheck.class.php

示例8: checkAdd

 public function checkAdd(&$model, array $param)
 {
     if (Validate::checkStrLength($_POST['name'], 20, 'max')) {
         $this->message[] = '售后服务名称不得超过20位';
         $this->flag = false;
     }
     if (Validate::isNullStr($_POST['name'])) {
         $this->message[] = '售后服务名称不得为空';
         $this->flag = false;
     }
     if (Validate::isNullStr($_POST['content'])) {
         $this->message[] = '售后服务内容不得为空';
         $this->flag = false;
     }
     if ($model->isOne($param)) {
         $this->message[] = '该售后服务已被占用';
         $this->flag = false;
     }
     return $this->flag;
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:20,代码来源:ServiceCheck.class.php

示例9: checkAdd

 public function checkAdd(&$model, array $param)
 {
     if (Validate::checkStrLength($_POST['name'], 2, 'min')) {
         $this->message[] = '属性名长度不得小于2位';
         $this->flag = false;
     }
     if (Validate::isNullStr($_POST['name'])) {
         $this->message[] = '属性名不得为空';
         $this->flag = false;
     }
     if (Validate::checkStrLength($_POST['name'], 4, 'max')) {
         $this->message[] = '属性名长度不得大于4位';
         $this->flag = false;
     }
     if ($model->isOne($param)) {
         $this->message[] = '属性名已被占用';
         $this->flag = false;
     }
     return $this->flag;
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:20,代码来源:AttrCheck.class.php

示例10: checkAdd

 public function checkAdd(&$model, array $param)
 {
     if (Validate::isNullStr($_POST['name'])) {
         $this->message[] = '收货人长度不得小于2位';
         $this->flag = false;
     }
     if (!Validate::isLength($_POST['code'], 6)) {
         $this->message[] = '邮政编码必须为6位';
         $this->flag = false;
     }
     if (Validate::checkStrLength($_POST['name'], 20, 'max')) {
         $this->message[] = '收货人不得大于20位';
         $this->flag = false;
     }
     if (!Validate::checkEmail($_POST['email'])) {
         $this->message[] = '邮箱格式不正确';
         $this->flag = false;
     }
     if ($model->isOne($param)) {
         $this->message[] = '收货人已被占用';
         $this->flag = false;
     }
     return $this->flag;
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:24,代码来源:AddressCheck.class.php

示例11: getListGoods

 public function getListGoods()
 {
     $id = $this->getId();
     $priceSql = '';
     $attrSql = '';
     $brandSql = '';
     $attrSql = '';
     if ($this->R['price']) {
         $priceSql = 'AND price_sale BETWEEN ' . str_replace(',', ' AND ', $this->R['price']);
     }
     if ($this->R['brand']) {
         $brandSql = ' AND brand=' . $this->R['brand'];
     }
     if ($this->R['attr']) {
         // 			$attrSql =str_replace('-', '%', $this->R['attr']);
         // 			$attrSql =" AND attr LIKE '%$attrSql%'";
         $temp = explode('-', $this->R['attr']);
         foreach ($temp as $key => $value) {
             $attrSql .= " AND attr LIKE '%{$value}%' ";
         }
     }
     $this->tables = array(DB_FREFIX . 'goods g');
     $allGoods = parent::select(array('id', 'name', 'thumb', 'price_sale', 'price_market', 'unit', 'sale_count', 'thumb_small', 'nav', '(SELECT COUNT(*) FROM mall_commend c WHERE c.goods_id=g.id) AS count'), array('where' => array("nav IN ('{$id}') {$priceSql} {$brandSql} {$attrSql}", 'is_up=1'), 'order' => 'date DESC', 'limit' => $this->limit));
     $this->tables = array(DB_FREFIX . 'goods');
     foreach ($allGoods as $value) {
         if (Validate::isNullStr($value->thumb_small)) {
             $img = new Image($value->thumb);
             $img->thumb(220, 220);
             $img->outImage('220x220');
             parent::update(array("id='{$value->id}'"), array('thumb_small' => $img->getPath()));
             $value->thumb_small = $img->getPath();
         }
     }
     return $allGoods;
 }
开发者ID:zhendeguoke1008,项目名称:shop-1,代码行数:35,代码来源:GoodsModel.class.php


注:本文中的Validate::isNullStr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。