<?php 

$sql = "SELECT * FROM publication_document_translation t1 
    INNER JOIN publication_document t2 ON t1.document_translation_parent_id=t2.document_id";
$model = Yii::$app->db->createCommand($sql)->queryAll();
$arr = [];
$status = 'failed';
if(!empty($model)){
    foreach($model as $row){
        $status = 'success';
        $arr2 = [];
        $arr2['language'] = $row['document_translation_language'];
        $arr2['title'] = $row['document_translation_title'];
        $arr2['content'] = $row['document_translation_content'];
        
         $arr2['category'] = $row['document_category'];
        $arr2['subcategory'] = $row['document_subcategory'];
        $arr2['status'] = $row['document_status'];
        $arr2['document_date'] = $row['document_date'];
        $arr2['sorting'] = $row['document_sorting'];
        $arr2['thumbnail'] = $row['document_image'];
        $arr2['background'] = $row['document_bckgd'];
        
        $arr[] = $arr2;
    }
}
echo json_encode(['result_status'=>$status,'data'=>$arr]);