TP5.0、5.1、6 where查询的坑

5.1之前的where写法

$where = array();

$where['name'] = 'php';

$where['phone'] = ['like','133%']

$where['age'] = ['>','13']

table('test')->where( $where )->select()

5.1之后where写法

$where = new Where;

$where['name'] = 'php';

$where['phone'] = ['like','133%']

$where['age'] = ['>','13']

table('test')->where( $where )->select()

6之后where写法

$where = [];

$where['name'] = 'php';

$where['phone'] = ['like','133%']

$where['age'] = ['>','13']

table('test')->where([$where])->select()

你可能感兴趣的:(TP5.0、5.1、6 where查询的坑)