AuctionOrderController.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace app\api\controller\auction;
  3. use app\models\auction\Auction;
  4. use app\models\auction\AuctionBooking;
  5. use app\models\auction\AuctionOrder;
  6. use app\models\auction\AuctionPay;
  7. use app\models\auction\AuctionSection;
  8. use app\models\user\User;
  9. use app\models\user\UserBill;
  10. use app\Request;
  11. use Monolog\Handler\Curl\Util;
  12. use think\facade\Cache;
  13. use crmeb\services\{
  14. CacheService,
  15. ExpressService,
  16. SystemConfigService
  17. };
  18. use crmeb\services\UtilService;
  19. use crmeb\repositories\OrderRepository;
  20. use think\facade\Db;
  21. use think\facade\Validate;
  22. class AuctionOrderController
  23. {
  24. /**
  25. * 查看是否已竞拍
  26. * @param Request $request
  27. * @return mixed
  28. * @throws \think\db\exception\DataNotFoundException
  29. * @throws \think\db\exception\DbException
  30. * @throws \think\db\exception\ModelNotFoundException
  31. */
  32. public function see_order(Request $request)
  33. {
  34. $data = UtilService::getMore([
  35. ['id']
  36. ]);
  37. $auction = Auction::where('id', $data['id'])->find();
  38. if (!$auction) return app('json')->fail('场次不存在');
  39. $order = AuctionOrder::where([['auction_id', '=', $auction['id']], ['frequency', '=', $auction['frequency']], ['uid', '=', $request->uid()]])->find();
  40. if ($order){
  41. $res = [
  42. 'status' => 1,
  43. 'order' => $order
  44. ];
  45. }else{
  46. $res = ['status' => 0];
  47. }
  48. return app('json')->successful($res);
  49. }
  50. }