本文整理匯總了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;
}
示例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'));
}
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}