|
@@ -85,8 +85,8 @@ class AuctionProductController
|
|
|
$auction = Auction::where('id', $product['auction_id'])->find();
|
|
|
$count = AuctionOrder::where('frequency',$auction['frequency'])->where('product_id', 'in', $product_ids)->count();
|
|
|
|
|
|
-
|
|
|
-
|
|
|
+ $config = SystemConfig::where('menu_name', 'auction_number')->find();
|
|
|
+ if ($count >= (int) preg_replace('~(,(?=[^"]*"(?:[^"]*"[^"]*")*[^"]*$)|")~', '', $config['value'])) return app('json')->fail('单场购买数量已到达最大');
|
|
|
|
|
|
if ($product['uid'] == $request->uid()) return app('json')->fail('无法购买自己商品');
|
|
|
if ($product){
|
|
@@ -155,7 +155,7 @@ class AuctionProductController
|
|
|
['image'],
|
|
|
['id']
|
|
|
]);
|
|
|
- if (!$data['image'] || !$data['id']) return app('json')->fail('数据传入错误');
|
|
|
+ if (!$data['image'] || !$data['id']) return app('json')->fail('请上传打款凭证');
|
|
|
|
|
|
$order = AuctionOrder::where('id', $data['id'])->find();
|
|
|
if (!$order) return app('json')->fail('订单不存在');
|
|
@@ -248,7 +248,7 @@ class AuctionProductController
|
|
|
|
|
|
if (empty($details)) return app('json')->fail('商品不存在');
|
|
|
$details['slider_image'] = is_string($details['slider_image']) ? json_decode($details['slider_image'], true) : [];
|
|
|
- $details['description'] = !empty($details['description']) ? html_entity_decode($details['description'], ENT_COMPAT) : [];
|
|
|
+ $details['description'] = !empty($details['description']) ? html_entity_decode($details['description'], ENT_COMPAT) : '';
|
|
|
$details['user_nickname'] = User::where('uid', $details['auction_id'])->find()['nickname'];
|
|
|
|
|
|
$auction = Auction::where('id', $details['auction_id'])->find();
|
|
@@ -272,6 +272,10 @@ class AuctionProductController
|
|
|
->leftJoin('user u', 'a.collection_id = u.uid')
|
|
|
->where('a.product_id', $data['product_id'])->where('a.status', 3)->select();
|
|
|
|
|
|
+ if (empty($order->toArray())) $order = AuctionProduct::alias('a')
|
|
|
+ ->field('u.nickname,u.avatar,a.create_time')
|
|
|
+ ->leftJoin('user u', 'a.uid = u.uid')
|
|
|
+ ->where('a.id', $data['product_id'])->select();
|
|
|
$order = empty($order)? [] : $order->toArray();
|
|
|
return app('json')->successful($order);
|
|
|
}
|