Welcome Guest, Not a member yet? Register   Sign In
Join in controller method
#3

PHP Code:
public function index()
    {

        $newsMediaModel = new NewsMediaModel();
  
        $result 
$newsMediaModel->select()
            ->join('news_post''news_post.id = news_media.post_id''left')
          
            
->where(['id'=>'2'])

            ->orderBy('id','desc')
            ->paginate(10'default',11);

        return $this->respond([
            'data' => $result,
            'pager' => $newsMediaModel->pager->getDetails()
        ], ResponseInterface::HTTP_OKlang('Shared.api.receive'));


    
Enlightenment  Is  Freedom
Reply


Messages In This Thread
Join in controller method - by pippuccio76 - 07-05-2021, 04:16 AM
RE: Join in controller method - by craig - 07-05-2021, 06:44 AM
RE: Join in controller method - by paliz - 07-05-2021, 12:13 PM
RE: Join in controller method - by ikesela - 07-05-2021, 12:22 PM
RE: Join in controller method - by pippuccio76 - 07-05-2021, 12:50 PM
RE: Join in controller method - by ikesela - 07-05-2021, 10:02 PM
RE: Join in controller method - by pippuccio76 - 07-06-2021, 03:54 AM
RE: Join in controller method - by manager - 07-05-2021, 10:23 PM



Theme © iAndrew 2016 - Forum software by © MyBB