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']], ['collection_id', '=', $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('撤销申诉成功');// 失败 } /** * 修改支付凭证 * @param Request $request * @return mixed * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\DbException * @throws \think\db\exception\ModelNotFoundException */ public function edit_voucher(Request $request) { $data = UtilService::getMore([ ['order_id'], ['image'] ]); if (!$data['image'] || !$data['order_id']) return app('json')->fail('请上传打款凭证'); $order = AuctionOrder::where('order_id', $data['order_id'])->find(); if (!$order) return app('json')->fail('订单不存在'); if ($order['status'] == 3) return app('json')->fail('当前订单已完成'); $auction = Auction::where('id', $order['auction_id'])->find(); if (strtotime($auction['radd_time']) > time() or strtotime($auction['rend_time']) < time()) return app('json')->fail('未到支付时间,支付时间为'.$auction['radd_time'].'-'.$auction['rend_time']); $order['upload_image'] = $data['image']; $order['status'] = 2; $order['voucher_time'] = time(); if ($order->save()){ return app('json')->successful('上传成功'); }else{ return app('json')->fail('上传失败'); } } }