'大坪天街时代店', 'order_number' => $this->order_number ??'', 'order_sn' => strval($this->order_sn), 'order_status' => $this->order_status ? ($this->pay_status ? ($this->shipping_status ? '已完成':'待取货'):'未支付'):'已取消', 'created_at' => $this->created_at->format('Y.m.d H:i'), 'order_goods' => OrderGoodsResource::collection($this->goods), 'order_prcie' => $this->ticket_value >0 ? number_format((intval($this->order_price*100) - intval($this->ticket_value*100))/100, 2):number_format($this->order_price, 2), 'pay_type' => $this->pay_type == 1 ? '微信支付':($this->pay_type == 2? '奖品兑换':'线下支付'), 'finished_at' => $this->shipping_time ? Carbon::parse($this->shipping_time)->toDateTimeString():'', 'closed_at' => $this->closed_time ? Carbon::parse($this->closed_time)->diffInSeconds(now(), true):'', 'is_niu' => $this->is_niu, 'qr_code' => $this->order_number ? base64_encode(QrCode::format('png')->size(100)->margin(0)->generate($this->order_number)) :'', 'is_reserve' => $this->is_reserve, 'reserve_time' => $this->is_reserve? Carbon::parse($this->reserve_time)->toDateString():'', 'ticket_value' => $this->ticket_id? number_format($this->ticket_value, 2):0, 'admin_ticket_name'=> $this->when($this->is_admin, $this->ticket->quanTicket->quan_name??''), 'admin_order_price'=> $this->when($this->is_admin, number_format($this->order_price??0, 2)), 'admin_pay_price'=> $this->when($this->is_admin, number_format($this->pay_price??0, 2)), 'admin_ticket_value'=> $this->when($this->is_admin, number_format($this->ticket_value??0, 2)), 'admin_order_phone'=> $this->when($this->is_admin, $this->order_phone), 'admin_order_status'=> $this->when($this->is_admin, $this->order_status), 'admin_pay_status'=> $this->when($this->is_admin, $this->pay_status), 'admin_shipping_status'=> $this->when($this->is_admin, $this->shipping_status), 'admin_order_time'=> $this->when($this->is_admin, $this->created_at ? Carbon::parse($this->created_at)->toDateTimeString():''), 'admin_pay_time'=> $this->when($this->is_admin, $this->pay_time ? Carbon::parse($this->pay_time)->toDateTimeString():''), 'admin_shipping_time'=> $this->when($this->is_admin, $this->shipping_time ? Carbon::parse($this->shipping_time)->toDateTimeString():''), ]; } public function with($request) { return ['code' => Response::HTTP_OK, 'message' => '']; } }