Taebu / prq

prq.co.kr
MIT License
1 stars 0 forks source link

st_ata_YN 값 알림톡결제 리스트 표시 #104

Closed moonsungjun closed 6 years ago

moonsungjun commented 6 years ago

https://prq.co.kr/prq/store/lists/prq_ata_pay/page/1

- -1

ATA 상태값 리스트에 표시

Taebu commented 6 years ago

image

Taebu commented 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');
}
Taebu commented 6 years ago

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]);?>