rxzxf1993
V2EX  ›  PHP

thinkphp5 提示 method not exist:think\db\Query->

  •  
  •   rxzxf1993 · May 31, 2017 · 10059 views
    This topic created in 3313 days ago, the information mentioned may be changed or developed.

    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();
    
    
    2 replies    2017-06-01 11:13:49 +08:00
    Spectre
        1
    Spectre  
       Jun 1, 2017
    ProviderCheck 改成 ProviderCheckModel ?
    Spectre
        2
    Spectre  
       Jun 1, 2017
    额 看错了 看成 model not exist 了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2962 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 02:13 · PVG 10:13 · LAX 19:13 · JFK 22:13
    ♥ Do have faith in what you're doing.