AuctionApply.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. namespace app\admin\controller\auction;
  3. use app\admin\controller\AuthController;
  4. use app\admin\controller\Union;
  5. use app\admin\model\auction\AuctionGu;
  6. use app\admin\model\User;
  7. use crmeb\services\{ExpressService,
  8. JsonService,
  9. MiniProgramService,
  10. upload\Upload,
  11. WechatService,
  12. FormBuilder as Form,
  13. CacheService,
  14. UtilService as Util,
  15. JsonService as Json};
  16. use app\admin\model\system\{
  17. SystemAttachment as SystemAttachmentModel, SystemAttachmentCategory as Category
  18. };
  19. use think\facade\Route as Url;
  20. use think\facade\Validate;
  21. /**
  22. * 竞拍管理
  23. * Class StoreOrder
  24. * @package app\admin\controller\store
  25. */
  26. class AuctionApply extends AuthController
  27. {
  28. public function index()
  29. {
  30. return $this->fetch();
  31. }
  32. public function list()
  33. {
  34. $where = Util::getMore([
  35. ['status', ''],
  36. ['page', 1],
  37. ['limit', 20],
  38. ['auction']
  39. ]);
  40. $data = \app\admin\model\auction\AuctionApply::list($where);
  41. return Json::successlayui($data);
  42. }
  43. public function tg($id)
  44. {
  45. if (empty($id)) return Json::fail('失败');
  46. $data = \app\admin\model\auction\AuctionApply::where('id', '<>',1)->find($id);
  47. if (!$data){
  48. return Json::fail('当前状态无法修改');
  49. }
  50. $res = \app\admin\model\auction\AuctionApply::update(['status' => 2, 'id' => $id]);
  51. if ($res){
  52. return Json::success('成功!');
  53. }else{
  54. return Json::fail(\app\admin\model\auction\Auction::getErrorInfo());
  55. }
  56. }
  57. public function jj($id)
  58. {
  59. if (empty($id)) Json::fail('失败');
  60. $data = \app\admin\model\auction\AuctionApply::where('id', '<>',1)->find($id);
  61. if (!$data){
  62. return Json::fail('当前状态无法修改');
  63. }
  64. $res = \app\admin\model\auction\AuctionApply::update(['status' => 0, 'id' => $id]);
  65. if ($res){
  66. return Json::success('成功!');
  67. }else{
  68. return Json::fail(\app\admin\model\auction\Auction::getErrorInfo());
  69. }
  70. }
  71. }