application/modules/api_v1/models/Auth_model.php
//Check social data exist in DB
Check social data exist in DB
Check social data exist in DB
function checkSocialExist($user_id,$social_id,$social_type){
        $query = $this->db->query('SELECT social_id,social_type,user_id FROM '.SOCIAL_ACCOUNT.' WHERE social_id = "'.$social_id.'" AND social_type = "'.$social_type.'" ') ; 
        $isExist = $query->row(); 
        if(!empty($isExist)){
            return $isExist;
        }
        else{
            $insertData = array(
                'user_id' => $user_id,
                'social_id' => $social_id,
                'social_type' => $social_type,
                'created_at' => datetime(), 
            );
            $insert_id = $this->common_model->insertData(SOCIAL_ACCOUNT,$insertData);
            if(!$insert_id){
                return FALSE;
            }
            return $insert_id;
        }
    }
function checkSocialExist ( $ user_id , $ social_id , $ social_type ) { $ query = $ this -> db -> query ( 'SELECT social_id,social_type,user_id FROM ' . SOCIAL_ACCOUNT . ' WHERE social_id = "' . $ social_id . '" AND social_type = "' . $ social_type . '" ' ) ; $ isExist = $ query -> row ( ) ; if ( ! empty ( $ isExist ) ) { return $ isExist ; } else { $ insertData = array ( 'user_id' => $ user_id , 'social_id' => $ social_id , 'social_type' => $ social_type , 'created_at' => datetime ( ) , ) ; $ insert_id = $ this -> common_model -> insertData ( SOCIAL_ACCOUNT , $ insertData ) ; if ( ! $ insert_id ) { return FALSE ; } return $ insert_id ; } }
Check social data exist in DB
Check social data exist in DB