Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 1368 | Revision 1428 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 1368 Revision 1377
Zeile 14... Zeile 14...
14
    use App\Models\Order;
14
    use App\Models\Order;
Zeile 15... Zeile 15...
15
 
15
 
16
    class OrderController extends Controller
16
    class OrderController extends Controller
17
    {
17
    {
18
        //
18
        //
19
        private int       $shipAddrId;
19
        private int $shipAddrId;
20
        private int       $billAddrId;
20
        private int $billAddrId;
21
        private Order     $order;
21
        private Order $order;
22
        private int       $orderId;
22
        private int $orderId;
23
        private OrderItem $orderItem;
23
        private OrderItem $orderItem;
Zeile 24... Zeile 24...
24
        private array     $orderItems;
24
        private array $orderItems;
25
 
25
 
26
        /**
26
        /**
27
         * Display a listing of the resource.
27
         * Display a listing of the resource.
28
         *
28
         *
29
         */
29
         */
30
        public function index(): Factory|View|Application
30
        public function index(): Factory|View|Application
-
 
31
        {
-
 
32
            //
-
 
33
            $orders = Order::with( [
-
 
34
                'shop',
-
 
35
                'orderType',
-
 
36
                'orderItem',
31
        {
37
                'billAddr',
32
            //
38
                'shipAddr'
33
            $orders = Order::with( [ 'shop', 'orderType', 'orderItem', 'billAddr', 'shipAddr' ] )->orderBy( "created_at", 'desc' )->paginate( 100 );
39
            ] )->orderBy( "created_at", 'desc' )->paginate( 100 );
Zeile 34... Zeile 40...
34
            return view( 'admin/orders', [ "orders" => $orders,] );
40
            return view( 'admin/orders', [ "orders" => $orders, ] );
35
        }
41
        }
36
 
42
 
Zeile 122... Zeile 128...
122
            return $this->orderId;
128
            return $this->orderId;
123
        }
129
        }
Zeile 124... Zeile 130...
124
 
130
 
125
        public function mail()
131
        public function mail()
126
        {
132
        {
-
 
133
            $webSettings = WebSetting::where( 'shop_id', '=', $this->order->shop_id )->where( 'order_type_id', '=', $this->order->order_type_id )->whereIn( 'id', [
-
 
134
                11,
-
 
135
                12,
-
 
136
                13,
-
 
137
                14,
-
 
138
                17,
-
 
139
                18,
-
 
140
                1000,
127
            $webSettings = WebSetting::where( 'shop_id', '=', $this->order->shop_id )->where( 'order_type_id', '=', $this->order->order_type_id )->whereIn( 'id', [ 11, 12, 13, 14, 17, 18, 1000, ] )->get();
141
            ] )->get();
128
            foreach ( $webSettings as $webSetting )
142
            foreach ( $webSettings as $webSetting )
129
            {
143
            {
130
                switch ( $webSetting->id )
144
                switch ( $webSetting->id )
131
                {
145
                {
Zeile 190... Zeile 204...
190
         * @return Factory|View|Application
204
         * @return Factory|View|Application
191
         */
205
         */
192
        public function edit( int $id ): Factory|View|Application
206
        public function edit( int $id ): Factory|View|Application
193
        {
207
        {
194
            //
208
            //
-
 
209
            $order = Order::with( [
-
 
210
                'shop',
-
 
211
                'orderType',
-
 
212
                'orderItem',
-
 
213
                'billAddr',
-
 
214
                'shipAddr'
-
 
215
            ] )->find( $id );
195
            $order = Order::with( [ 'shop', 'orderType', 'orderItem', 'billAddr', 'shipAddr' ] )->find( $id );
216
            $order->kk_info = unserialize( $order->kk_info );
196
            return view( 'admin/order', [ "order" => $order, ] );
217
            return view( 'admin/order', [ "order" => $order, ] );
197
        }
218
        }
Zeile 198... Zeile 219...
198
 
219
 
199
 
220
 
200
        /**
221
        /**
201
         * Update the specified resource in storage.
222
         * Update the specified resource in storage.
202
         *
223
         *
203
         * @param ActionRequest $request
224
         * @param ActionRequest $request
204
         * @param int $id
225
         * @param int           $id
205
         * @return RedirectResponse
226
         * @return RedirectResponse
206
         */
227
         */
207
        public function update( ActionRequest $request, int $id ): RedirectResponse
228
        public function update( ActionRequest $request, int $id ): RedirectResponse