mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-04-25 10:56:38 +08:00
Update Order.php
This commit is contained in:
parent
95751ca512
commit
300922fe5f
@ -76,7 +76,7 @@ class Order extends Auth
|
|||||||
$map = ['goods_code' => $code, 'goods_spec' => $spec, 'status' => 1];
|
$map = ['goods_code' => $code, 'goods_spec' => $spec, 'status' => 1];
|
||||||
$goodsItem = $this->app->db->name('ShopGoodsItem')->where($map)->find();
|
$goodsItem = $this->app->db->name('ShopGoodsItem')->where($map)->find();
|
||||||
if (empty($goodsItem)) $this->error('商品规格异常');
|
if (empty($goodsItem)) $this->error('商品规格异常');
|
||||||
// 限制数量
|
// 限制购买数量
|
||||||
if (isset($goods['limit_max_num']) && $goods['limit_max_num'] > 0) {
|
if (isset($goods['limit_max_num']) && $goods['limit_max_num'] > 0) {
|
||||||
$map = [['a.status', 'in', [2, 3, 4, 5]], ['b.goods_code', '=', $goods['code']], ['a.uid', '=', $this->uuid]];
|
$map = [['a.status', 'in', [2, 3, 4, 5]], ['b.goods_code', '=', $goods['code']], ['a.uid', '=', $this->uuid]];
|
||||||
$buys = $this->app->db->name('StoreOrder')->alias('a')->join('store_order_item b', 'a.order_no=b.order_no')->where($map)->sum('b.stock_sales');
|
$buys = $this->app->db->name('StoreOrder')->alias('a')->join('store_order_item b', 'a.order_no=b.order_no')->where($map)->sum('b.stock_sales');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user