Closed moonsungjun closed 6 years ago
store_m.php
function get_store_ata($list)
{
$list=json_decode(json_encode($list), True);
$st_no = array_column($list, 'st_no');
$this->db->select('st_no, st_name, st_ata_YN');
$this->db->where_in('st_no', $st_no);
$this->db->from('prq_store');
$query = $this->db->get();
$result = $query->result();
return $result;
}
store.php
/**
* 목록 불러오기
*/
public function lists()
{
...중략...
$data['list'] = $this->store_m->get_list2($this->uri->segment(3),
'', $start, $limit, $search_array);
...중략...
$data['store'] = $this->store_m->get_store_ata($data['list']);
$data['store']=json_decode(json_encode($data['store']), True);
$data['store'] = array_column($data['store'], 'st_ata_YN','st_no');
}
list_v.php
$ata_yn=$store[$lt->st_no];
$is_ata=$ata_yn=="Y";
$ata_status=$is_ata?"success":"danger";
...중략...
<?php
printf('<button type="button" class="btn btn-%s btn-xs">%s</button>',
$ata_status,
$store[$lt->st_no]);?>
https://prq.co.kr/prq/store/lists/prq_ata_pay/page/1
ATA 상태값 리스트에 표시