This commit is contained in:
baji 2025-03-28 20:56:05 +08:00
parent d8a92ee04f
commit 63dafeff3d
5 changed files with 53 additions and 17 deletions

View File

@ -34,6 +34,16 @@
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">是否显示在吧唧赏内</label>
<div class="layui-input-inline" style="width: 700px">
<input type="radio" name="is_shouye" value="0"
class="layui-input" title="否" checked>
<input type="radio" name="is_shouye" value="1"
class="layui-input" title="是">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">是否首抽五折</label>
<div class="layui-input-inline" style="width: 700px">

View File

@ -32,6 +32,15 @@
disabled {if $type eq 11} checked {/if}>
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">是否显示在吧唧赏内</label>
<div class="layui-input-inline" style="width: 700px">
<input type="radio" name="is_shouye" {if $info.is_shouye eq 0} checked {/if} value="0"
class="layui-input" title="否" checked>
<input type="radio" name="is_shouye" {if $info.is_shouye eq 1} checked {/if} value="1"
class="layui-input" title="是">
</div>
</div>
<div class="layui-form-item">
<label class="layui-form-label">是否首抽五折</label>
<div class="layui-input-inline" style="width: 700px">

Binary file not shown.

View File

@ -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'] . '次');
}
}

View File

@ -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);