...
|
...
|
@@ -150,8 +150,9 @@ class IntegralGoods extends Model |
|
|
*/
|
|
|
public function checkStockNum($goodsId,$number){
|
|
|
$sum_stock_num = $this->alias('g')
|
|
|
->join('fa_integral_depot d','g.id=d.goods_id')
|
|
|
->join('fa_depot d','g.id=d.goods_id')
|
|
|
->where(['g.id' => $goodsId])
|
|
|
->where('type',2)
|
|
|
->field('d.id,d.stock_num')
|
|
|
->sum('d.stock_num');
|
|
|
if($number > $sum_stock_num){
|
...
|
...
|
|