审查视图

app/portal/controller/LogisticsController.php 1.6 KB
王晓刚 authored
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
<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/6/7
 * Time: 19:11
 */

namespace app\portal\controller;


use app\portal\model\IndentGoodsModel;
use app\portal\model\IndentModel;
use cmf\controller\WeChatBaseController;

class LogisticsController extends WeChatBaseController
{
    public function index(){
        $indent_id = $this->request->param('indent_id',0,'intval');
        if(empty($indent_id)){
            $this->error('缺少必要参数','','','');
        }
        $birdController = new BirdController();
        $indentModel = new IndentModel();
        $where['id'] = ['eq',$indent_id];
        $data = $indentModel->findData($where);
        if(empty($data)){
            $this->error('查询为空','','','');
        }
30 31 32 33 34 35 36 37 38 39 40
//        if($data['is_courier'] == 1){
//            $result['data'] = $data['start_time'];
//        }else{
//            $result = $birdController->getOrder($indent_id);
//            if(empty($result)){
//                $this->error('未知错误','','');
//            }
//            if($result['code'] != 20000){
//                $this->error($result['msg'],'','','');
//            }
//        }
王晓刚 authored
41 42 43 44
        $indent = $indentModel->findData(['id'=>$indent_id])->toArray();
        $indentGoodsModel = new IndentGoodsModel();
        $indent_goods = $indentGoodsModel->selectData(['indent_id'=>$indent_id]);
        $indent['indent_goods'] = $indent_goods;
45
//        $this->assign('data',$result['data']);
46
        $this->assign('data2',$data->toArray());
王晓刚 authored
47 48 49 50 51
        $this->assign('indent',$indent);
        return $this->fetch();
    }

}