Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

semour / semour_admin

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Settings
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Find file
BlameHistoryPermalink
Switch branch/tag
  • semour_admin
  • app
  • Admin
  • Controllers
  • Api
  • OrderApiController.php
  • 孙龙's avatar
    pi文件 · c39eb403
    孙龙 committed 2 years ago
    c39eb403
OrderApiController.php 1.52 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
<?php

namespace App\Admin\Controllers\Api;

use App\Admin\Service\OrderService;
use App\Models\Increasid;
use App\Models\OrderAddress;
use Illuminate\Http\Request;
use Illuminate\Routing\Controller;
use Maatwebsite\Excel\Facades\Excel;


class OrderApiController extends Controller
{
    
    public function orderDownloadShow(Request $request){

        $params = $request->all();
        $type = arrayGet($params, "type");

        $order_id = 1;
        $orderAddressList = OrderService::getOrderAddress($order_id);
        $orderAddressList = arrayChangeKeyByField($orderAddressList,"order_address_type");
        dump($orderAddressList);
        $info["sn"] = OrderService::getSn($type);
        if(empty($info["sn"])){
            abort(500, '获取编码失败');
        }
        if($type == "1"){
            //PI
            return view('export.order_contract_PI',[
                "ship"=>$orderAddressList[1]??[],
                "bill"=>$orderAddressList[2]??[],
                "info"=>$info
                ]);
        }elseif($type == "2"){
            //CI
            return view('export.order_contract_CI');
        }else{
            //PL
            return view('export.order_contract_PL');
        }

    }


    public function orderList(Request $request){
        return response()->json(["code"=>0,"msg"=>"ok","data"=>[],"count"=>0]);
    }
    
    
    public function orderDownload(Request $request){

//        $params = $request->all();
//        return Excel::download(new \App\Exports\ContractExport(),'PI.xlsx');
    }
}