Skip to content

Commit

Permalink
修复一处逻辑错误
Browse files Browse the repository at this point in the history
  • Loading branch information
assimon committed Jun 30, 2018
1 parent b9b6501 commit 57baf39
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/controller/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ public function postOrder()
if($post['gid'] =="" || intval($post['number']) <=0 || $post['account'] == ""){
resMsg(0,null,'充值账号、数量、商品不能为空,请仔细填写');
}
if(!is_int($post['number'])){
resMsg(0,null,'商品数量请填写整数!');
}
$goods = $this->model()->select()->from('goods')->where(array('fields' => 'id=?', 'values' => array($post['gid'])))->fetchRow();
if(!$goods || $goods['is_ste'] == 0) resMsg(0,null,'商品不存在或已下架');
if($goods['kuc'] < $post['number'])resMsg(0,null,'库存不足');
Expand Down

0 comments on commit 57baf39

Please sign in to comment.