<?php 
$article_id = '';
$arr = [];
$status = 'failed';
$remark = '';
if(isset($_GET['article_id'])&&!empty($_GET['article_id'])){
    $article_id = $_GET['article_id'];
    $sql = "SELECT * FROM content_article_translation t1 
        INNER JOIN content_article t2 ON t1.article_translation_parent_id=t2.article_id WHERE t2.article_id=".$article_id;
    $model = Yii::$app->db->createCommand($sql)->queryAll();
    
    if(!empty($model)){
        foreach($model as $row){
            $status = 'success';
            $arr2 = [];
            $arr2['language'] = $row['article_translation_language'];
            $arr2['title'] = $row['article_translation_title'];
            $arr2['content'] = $row['article_translation_content'];
            $arr2['tag'] = $row['article_translation_tag'];
            
            $arr2['portal_category'] = $row['article_portal_category'];
            $arr2['category'] = $row['article_category'];
            $arr2['subcategory'] = $row['article_subcategory'];
            $arr2['status'] = $row['article_status'];
            $arr2['article_date'] = $row['article_date'];
            $arr2['sorting'] = $row['article_sorting'];
            $arr2['url_related'] = $row['article_url'];
            $arr2['thumbnail'] = $row['article_image'];
            
            $arr[] = $arr2;
        }
    }else{
        $remark = 'Record not found';
    }
    
}else{
    $remark = 'Please specify the article_id using $_GET method';
}
echo json_encode(['result_status'=>$status,'remark'=>$remark,'data'=>$arr]);