OrderscourierController.php 1.2 KB
<?php
namespace app\admin\controller;

use app\admin\model\RouteModel;
use cmf\controller\AdminBaseController;
use think\Db;
class OrderscourierController extends AdminBaseController{

    /**
     *平台订单列表
     */
    public function order_list(){

        if($this -> request -> isPost()){
            $where = [
                "indent_type" => 1
            ];
            if(!empty($_POST['start_time']) && !empty($_POST['end_time'])){
                $start_time = strtotime($_POST['start_time']);
                $end_time = strtotime($_POST['end_time']);
                $where['create_time'] = [['>=',$start_time],['<=',$end_time]];
            }
            if(!empty($_POST['keyword'])){
                $where['order_number'] = $_POST['keyword'];
            }
            if(!empty($_POST['state'])){
                $where['state'] = $_POST['state'];
            }
            $data = Db::name('indent') -> where($where) -> where("state = 2 or state = 3 or state = 5") -> paginate(12);
        }else{
            $data = Db::name('indent') -> where('indent_type','1') -> where("state = 2 or state = 3 or state = 5") -> paginate(12);
        }
        $this -> assign('data',$data);
        return $this -> fetch();

    }










}