model 是这样写的
<?php
namespace lib\model;
use lib\BaseModel;
use lib\model\Provider;
class ProviderCheck extends BaseModel
{
//
public function provider()
{
return $this->hasOne('provider','id','userid','p','left');
}
}
调用
$condition = $this->buildProviderCheckConditon($searchData);
$providerCheckModel = new ProviderCheck();
$list = $providerCheckModel
->alias('pc')
->provider()
->where($condition['condition'])
->limit($condition['perpage']*($condition['p']-1), $condition['perpage'])
->select();
1
Spectre 2017-06-01 11:12:32 +08:00
ProviderCheck 改成 ProviderCheckModel ?
|
2
Spectre 2017-06-01 11:13:49 +08:00
额 看错了 看成 model not exist 了
|