|
@@ -0,0 +1,94 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace app\api\controller\auction;
|
|
|
+
|
|
|
+
|
|
|
+use app\models\auction\Auction;
|
|
|
+use app\models\auction\AuctionApply;
|
|
|
+use app\models\auction\AuctionBooking;
|
|
|
+use app\models\auction\AuctionGu;
|
|
|
+use app\models\auction\AuctionOrder;
|
|
|
+use app\models\auction\AuctionPay;
|
|
|
+use app\models\auction\AuctionProduct;
|
|
|
+use app\models\auction\AuctionTime;
|
|
|
+use app\models\user\User;
|
|
|
+use app\models\user\UserBill;
|
|
|
+use app\Request;
|
|
|
+use Monolog\Handler\Curl\Util;
|
|
|
+use think\facade\Cache;
|
|
|
+use crmeb\services\{
|
|
|
+ CacheService,
|
|
|
+ ExpressService,
|
|
|
+ SystemConfigService
|
|
|
+};
|
|
|
+use crmeb\services\UtilService;
|
|
|
+use crmeb\repositories\OrderRepository;
|
|
|
+use think\facade\Db;
|
|
|
+use think\facade\Validate;
|
|
|
+
|
|
|
+
|
|
|
+class AuctionOrderController
|
|
|
+{
|
|
|
+
|
|
|
+ * 申诉
|
|
|
+ * @param Request $request
|
|
|
+ * @return mixed
|
|
|
+ * @throws \think\db\exception\DataNotFoundException
|
|
|
+ * @throws \think\db\exception\DbException
|
|
|
+ * @throws \think\db\exception\ModelNotFoundException
|
|
|
+ */
|
|
|
+ public function plead(Request $request)
|
|
|
+ {
|
|
|
+ $data = UtilService::postMore([
|
|
|
+ 'order_id'
|
|
|
+ ]);
|
|
|
+ $order = AuctionOrder::where([['order_id', '=', $data['order_id']], ['uid', '=', $request->uid()]])->find();
|
|
|
+ if ($order['appeal'] == 1) return app('json')->fail('该订单已在申诉中');
|
|
|
+ if (!$order) return app('json')->fail('没有订单');
|
|
|
+ $product = AuctionProduct::where('id', $order['product_id'])->find();
|
|
|
+
|
|
|
+ $product['is_show'] = 0;
|
|
|
+ $product['frozen'] = 1;
|
|
|
+ $order['appeal'] = 1;
|
|
|
+ $order['is_gs'] = 0;
|
|
|
+ $order->save();
|
|
|
+ $product->save();
|
|
|
+ AuctionTime::where([ ['product_id', '=', $product['id']], ['uid', '=', $request->uid()]])->delete();
|
|
|
+ return app('json')->success('申诉成功');
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ * 撤销申诉
|
|
|
+ * @param Request $request
|
|
|
+ * @return mixed
|
|
|
+ * @throws \think\db\exception\DataNotFoundException
|
|
|
+ * @throws \think\db\exception\DbException
|
|
|
+ * @throws \think\db\exception\ModelNotFoundException
|
|
|
+ */
|
|
|
+ public function revoke(Request $request)
|
|
|
+ {
|
|
|
+ $data = UtilService::postMore([
|
|
|
+ 'order_id'
|
|
|
+ ]);
|
|
|
+ $order = AuctionOrder::where([['order_id', '=', $data['order_id']], ['uid', '=', $request->uid()]])->find();
|
|
|
+ if ($order['appeal'] == 0) return app('json')->fail('该订单未申诉');
|
|
|
+ if (!$order) return app('json')->fail('没有订单');
|
|
|
+ $product = AuctionProduct::where('id', $order['product_id'])->find();
|
|
|
+
|
|
|
+ $product['frozen'] = 0;
|
|
|
+ $order['appeal'] = 0;
|
|
|
+ $order->save();
|
|
|
+ $product->save();
|
|
|
+ return app('json')->success('撤销申诉成功');
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|