|
@@ -142,14 +142,14 @@ class Resign extends BaseController
|
|
}
|
|
}
|
|
|
|
|
|
//校验数量
|
|
//校验数量
|
|
- $goodnake =Db::name("good_nake")
|
|
|
|
- ->field('id')
|
|
|
|
- ->where([["spuCode","=",$good_code],["is_del","=",0]])
|
|
|
|
- ->where('min_num','<=',$good_num)
|
|
|
|
- ->order("min_num desc")
|
|
|
|
|
|
+ $goodnake = Db::name("good_nake")
|
|
|
|
+ ->field('id,min_num')
|
|
|
|
+ ->where([["spuCode", "=", $good_code], ["is_del", "=", 0]])
|
|
|
|
+ ->order("min_num asc")
|
|
->find();
|
|
->find();
|
|
|
|
|
|
- if(empty($goodnake)) return error_show(1004,'未找到符合条件的商品成本数据');
|
|
|
|
|
|
+ if (empty($goodnake)) return error_show(1004, '未找到商品成本数据');
|
|
|
|
+ if ($goodnake['min_num'] > $good_num) return error_show(1004, '该商品最低采购数量为' . $goodnake['min_num']);
|
|
|
|
|
|
|
|
|
|
$lastime = isset($this->post['lastime'])&&$this->post['lastime']!="" ? $this->post['lastime']:"";
|
|
$lastime = isset($this->post['lastime'])&&$this->post['lastime']!="" ? $this->post['lastime']:"";
|