标签 tp6 下的文章

switch ($searchType) {
            case 'name':
                $res = OrdersModel::hasWhere('personBase',['name'=>$searchText])->paginate(100);
                break;
            case 'phone':
                $res = OrdersModel::hasWhere('personBase',['phone'=>$searchText])->paginate(100);
                break;
            case 'icard':
                $res = OrdersModel::hasWhere('personBase',['icard'=>$searchText])->paginate(100);
                break;
            case 'out_trade_no':
                $res = OrdersModel::with('personBase')->where(['out_trade_no'=>$searchText])->paginate(10);
                break;
            case 'transaction_id':
                $res = OrdersModel::with('personBase')->where(['transaction_id'=>$searchText])->paginate(10);
                break;
        }