<?php

defined('BASEPATH') or exit('No direct script access allowed');

/**
 * @property Event_setting_model $Event_setting_model
 * @property Promotion_setting_model $Promotion_setting_model
 */
class System_setting extends MY_ApiController
{
    public function index()
    {
        $this->load->model('Event_setting_model');
        $this->load->model('Promotion_setting_model');

        $this->is_get();
        $tenant_no = $this->input->get('tenant_no');

        $event_setting_path =  $this->Event_setting_model->get_path();
        $promotion_setting_path = $this->Promotion_setting_model->get_path();

        $this->Event_setting_model->setTenantNo($tenant_no);
        $this->Promotion_setting_model->setTenantNo($tenant_no);

        echo $this->respond([
            'event_default_no_image' => base_url() . $event_setting_path . '/' . $this->Event_setting_model->detail()['filename'],
            'promotion_default_no_image' => base_url() . $promotion_setting_path . '/' . $this->Promotion_setting_model->detail()['filename'],
        ]);
    }
}
