|
|
@@ -137,6 +137,26 @@ class AuctionProductController
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 挂售详情
|
|
|
+ * @param Request $request
|
|
|
+ * @return mixed
|
|
|
+ * @throws \think\db\exception\DataNotFoundException
|
|
|
+ * @throws \think\db\exception\DbException
|
|
|
+ * @throws \think\db\exception\ModelNotFoundException
|
|
|
+ */
|
|
|
+ public function gsxq(Request $request)
|
|
|
+ {
|
|
|
+ $data = UtilService::postMore([
|
|
|
+ ['id']
|
|
|
+ ]);
|
|
|
+ $product = AuctionProduct::where('id', $data['id'])->find();
|
|
|
+
|
|
|
+ $data['aid_val'] = round($product['hanging_price'] * 0.0485, 2); // 需要的广告值
|
|
|
+ $data['hanging_price'] = round((int)$product['hanging_price'] + $product['hanging_price'] * 0.06, 2); // 第二天溢价
|
|
|
+
|
|
|
+ return app('json')->successful($data);
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 挂售商品
|
|
|
@@ -156,11 +176,11 @@ class AuctionProductController
|
|
|
$user = User::where('uid', $request->uid())->find();
|
|
|
if (!$product) return app('json')->fail('商品不存在');
|
|
|
|
|
|
- $aid_val = $product['hanging_price'] * 0.0485; // 需要的广告值
|
|
|
- $hanging_price = $product['hanging_price'] * 0.06; // 第二天溢价
|
|
|
+ $aid_val = round($product['hanging_price'] * 0.0485,2); // 需要的广告值
|
|
|
+ $hanging_price = round((int)$product['hanging_price'] + $product['hanging_price'] * 0.06, 2); // 第二天溢价
|
|
|
if ($user['aid_val'] < $aid_val) return app('json')->fail('挂售需要广告值不足');
|
|
|
|
|
|
- $product['hanging_price'] += $hanging_price;
|
|
|
+ $product['hanging_price'] = $hanging_price;
|
|
|
$product['is_show'] = 1;
|
|
|
$user['aid_val'] -= $aid_val;
|
|
|
|