1.

$rs = M('order')->where('id='.$res['id'])->save($order);
            if(!(is_numeric($rs) && intval($rs) > 0)){
                M('member')->where('id='.$member_id)->lock(true)->setDec('money',$res['price']);
                $this->error('订单取消失败');
            }

thinkphp的save($data) 返回数据 成功:$rs =1, 失败 :$rs =0

is_numeric 判断是否为数字,或者是数值型的字符串则为ture,否则为false 

 

相关文章:

  • 2021-09-09
  • 2022-12-23
  • 2021-09-29
  • 2021-08-02
  • 2021-10-31
  • 2021-12-26
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-24
  • 2021-09-06
  • 2021-08-20
  • 2021-08-17
  • 2022-12-23
  • 2021-08-23
相关资源
相似解决方案