LogisticsController.php
1.6 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
<?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('查询为空','','','');
}
// 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'],'','','');
// }
// }
$indent = $indentModel->findData(['id'=>$indent_id])->toArray();
$indentGoodsModel = new IndentGoodsModel();
$indent_goods = $indentGoodsModel->selectData(['indent_id'=>$indent_id]);
$indent['indent_goods'] = $indent_goods;
// $this->assign('data',$result['data']);
$this->assign('data2',$data->toArray());
$this->assign('indent',$indent);
return $this->fetch();
}
}