diff --git a/app/admin/view/Goods/goods_add.html b/app/admin/view/Goods/goods_add.html index 9054764..95a326f 100755 --- a/app/admin/view/Goods/goods_add.html +++ b/app/admin/view/Goods/goods_add.html @@ -34,6 +34,16 @@ + +
+ +
+ + +
+
diff --git a/app/admin/view/Goods/goods_edit.html b/app/admin/view/Goods/goods_edit.html index b0714b9..0b44bd1 100755 --- a/app/admin/view/Goods/goods_edit.html +++ b/app/admin/view/Goods/goods_edit.html @@ -32,6 +32,15 @@ disabled {if $type eq 11} checked {/if}>
+
+ +
+ + +
+
diff --git a/app/admin/view/view_kM6dcB.tar.gz b/app/admin/view/view_kM6dcB.tar.gz deleted file mode 100755 index d29ce36..0000000 Binary files a/app/admin/view/view_kM6dcB.tar.gz and /dev/null differ diff --git a/app/api/controller/Goods.php b/app/api/controller/Goods.php index c554dec..7ffbb49 100755 --- a/app/api/controller/Goods.php +++ b/app/api/controller/Goods.php @@ -63,7 +63,14 @@ class Goods extends Base $whe[] = ['type', '=', 2]; } elseif ($type_str == 3) { $whe[] = ['type', '=', 3]; - } elseif ($type_str == 5) { + } elseif ($type_str == 4) { + // $whe[] = ['type', '=', 6]; + // 添加 (type = 1 or is_shouye = 1) 条件 + $whe[] = function ($query) { + $query->where('type', '=', 1) + ->whereOr('is_shouye', '=', 1); + }; + } elseif ($type_str == 5) { $whe[] = ['type', '=', 5]; } elseif ($type_str == 6) { $whe[] = ['type', '=', 6]; @@ -77,7 +84,6 @@ class Goods extends Base $paginate = 999; $whe[] = ['type', '=', 10]; } elseif ($type_str == 11) { - $whe[] = ['type', '=', 11]; } elseif ($type_str == 12) { $whe[] = ['type', '=', 9]; @@ -521,13 +527,13 @@ class Goods extends Base if ($goods['type'] == 6 && $goods['quanju_xiangou'] > 0) { //限购 $user_xiangou_count = OrderList::field('id')->where('goods_id', '=', $goods_id) - ->where('num', '=', $num) - ->where('shang_id', 'between', self::$shang_count_id) - ->where('order_type', '=', $goods['type']) - ->where('user_id', '=', $user['id']) - ->count(); + ->where('num', '=', $num) + ->where('shang_id', 'between', self::$shang_count_id) + ->where('order_type', '=', $goods['type']) + ->where('user_id', '=', $user['id']) + ->count(); //已经达到限购先上限 - if($goods['quanju_xiangou']<=$user_xiangou_count){ + if ($goods['quanju_xiangou'] <= $user_xiangou_count) { return $this->renderError('当前箱子限购' . $goods['quanju_xiangou'] . '次'); } } diff --git a/app/api/controller/Warehouse.php b/app/api/controller/Warehouse.php index 102afa3..5f82d88 100755 --- a/app/api/controller/Warehouse.php +++ b/app/api/controller/Warehouse.php @@ -99,7 +99,7 @@ class Warehouse extends Base return imageUrl($value); }) ->withAttr('goodslist_money', function ($value, $data) { - return (float) $value * 100; + return (float) $value ; }) ->group("prize_code") ->select()->toArray(); @@ -159,7 +159,7 @@ class Warehouse extends Base return imageUrl($value); }) ->withAttr('goodslist_money', function ($value, $data) { - return (float) $value * 100; + return (float) $value; }) ->withAttr('goodslist_sale_time', function ($value, $data) { return date('Y-m-d', $value); @@ -276,7 +276,7 @@ class Warehouse extends Base return imageUrl($value); }) ->withAttr('goodslist_money', function ($value, $data) { - return (float) $value * 100; + return (float) $value; }) ->group("prize_code") ->select()->toArray(); @@ -333,7 +333,7 @@ class Warehouse extends Base return imageUrl($value); }) ->withAttr('goodslist_money', function ($value, $data) { - return (float) $value * 100; + return (float) $value; }) ->group("prize_code") ->select()->toArray(); @@ -638,10 +638,10 @@ class Warehouse extends Base 'choice_time' => time(), ]); #兑换金额 - $total_money *= 100; + // $total_money *= 100; if ($total_money > 0) { - // $res[] = User::changeMoney($user_id, $total_money, 4, '兑换获得'); - User::changeIntegral($user_id, $total_money, 4, '兑换获得'); + $res[] = User::changeMoney($user_id, $total_money, 4, '兑换获得'); + // User::changeIntegral($user_id, $total_money, 4, '兑换获得'); } if (resCheck($res)) { Db::commit(); @@ -683,11 +683,21 @@ class Warehouse extends Base #装换结构 $recovery_info = json_decode($recovery_info, true); $order_list_id = []; + $goodslist_money_sum = 0; foreach ($recovery_info as $value) { $lim = $value['number']; if (is_string($lim)) { $lim = intval($lim); } + $goodslist_money_list = OrderList::field('goodslist_money') + ->where('user_id', '=', $user_id) + ->where('status', '=', 0) + ->where('insurance_is', '=', 0) + ->where('goodslist_type', '=', 1) + ->where('prize_code', '=', trim($value['prize_code'])) + ->limit($lim) + ->column("goodslist_money"); + $goodslist_moneys = array_sum($goodslist_money_list); $order_list_ids = OrderList::field('id') ->where('user_id', '=', $user_id) ->where('status', '=', 0) @@ -697,8 +707,9 @@ class Warehouse extends Base ->limit($lim) ->column("id"); $order_list_id = array_merge($order_list_id, $order_list_ids); + $goodslist_money_sum += $goodslist_moneys; } - if (!$order_list_id) { + if ($goodslist_money_sum == 0) { return $this->renderError("请刷新重新选择奖品"); } #发货数量 @@ -754,7 +765,7 @@ class Warehouse extends Base #为满足发货条件 // // dd($free_post,$count); - if ($free_post > $count && $post_money > 0) { + if ($goodslist_money_sum < 288) { $body = '背包发货' . $count . '件'; $attach = 'order_list_send'; $payRes = (new Pay())->wxCreateOrder($send_num, $post_money, $user['openid'], $body, $attach);