Taebu / prq

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

톡톡메시지 블로그 url 주소 On/Off 기능 추가 요청 #64

Closed moonsungjun closed 7 years ago

moonsungjun commented 7 years ago

http://prq.co.kr/prq/store/modify/prq_store/board_id/434/page/1

※상점 수정에서 블로그 on / off 기능 추가


on 으로 켜질 시

리뷰 이벤트 (2,000원 지급) http://블로그 url 주소


참조

(광고) [ 톡톡메시지 ] 에서 최고의 맛과 서비스로 보답하겠습니다.

고객님을 위한 매장 홈페이지를 확인하세요. http://prq.co.kr/prq/page/60

매장과의 통화는 아래 번호를 이용해주세요. 031-904-4084

현금주는 배달어플 출시!! 다운로드 시 무조건 2,000원 적립 http://bdtalk.co.kr/m/p/

리뷰 이벤트(2,000원 적립) http://prq.co.kr/prq/blog/write/60/

무료수신거부 080-130-8119


off 일 시

문구 발송이 안됨.

★ 기본 값은 off 로 만들어 주시면 됩니다.

Taebu commented 7 years ago
mysql> show create table codes\G;
*************************** 1. row ***************************
       Table: codes
Create Table: CREATE TABLE `codes` (
  `code` int(6) NOT NULL,
  `pcode` int(6) NOT NULL,
  `code_name` varchar(100) DEFAULT NULL,
  `code_value` varchar(100) DEFAULT NULL,
  `seq` int(3) DEFAULT NULL,
  `use_bit` char(1) DEFAULT NULL,
  PRIMARY KEY (`code`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
1 row in set (0.00 sec)
mysql> show create table store_icon\G;
*************************** 1. row ***************************
       Table: store_icon
Create Table: CREATE TABLE `store_icon` (
  `st_seq` int(10) unsigned NOT NULL,
  `si_code` int(10) unsigned NOT NULL,
  `si_value` varchar(50) NOT NULL DEFAULT '',
  `si_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=MyISAM DEFAULT CHARSET=utf8
1 row in set (0.00 sec)

ERROR:
No query specified

두개의 테이블 분석하여 만들것 cashq.codes -> prq.prq_codes cashq.store_icon -> prq.prq_values

mysql> show create table codes\G;
CREATE TABLE `prq_codes` (
  `code` int(6) NOT NULL comment '키값이 되는 코드',
  `pcode` int(6) NOT NULL  comment '코드의 부모 코드',
  `code_name` varchar(100) DEFAULT NULL comment  '코드의 이름',
  `code_value` varchar(100) DEFAULT NULL comment  '코드의 설명',
  `seq` int(3) DEFAULT NULL,
  `use_bit` char(1) NOT NULL DEFAULT '1' comment  '코드의 사용여부',
  PRIMARY KEY (`code`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
CREATE TABLE `prq_values` (
  `pv_code` int(10) unsigned NOT NULL comment 'codes의 code값',
  `pv_no` int(10) unsigned NOT NULL comment '기관 인덱스',
  `pv_value` varchar(50) NOT NULL DEFAULT '' comment 'codes의 code값',
  `pv_datetime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
Taebu commented 7 years ago

65 " prq 상점 원산지" 관련하여 만들어야 해서 블로그 url 문제는 잠시 중지.

Taebu commented 7 years ago

65 종료 됨에 따라 다시 만들기.

alter table prq_values modify pv_value varchar(2000) not null default '' comment 'codes의 code값';
Taebu commented 7 years ago

prq_codes 에 5002 블로그 url

Taebu commented 7 years ago

/prq/application/views/crontab/view_v.php

/* blog on /off 정보 에 따른 블로그 url 첨부*/
$is_blogon=$controller->crontab_m->get_blog_yn($st->st_no);

if($is_blogon->pv_value=="on")
{
    $msg[]="";
    $msg[]="리뷰 이벤트 (2,000원 지급)";
    $msg[]="http://prq.co.kr/prq/blog/write/".$st->st_no;
}

/prq/application/models/crontab_m.php

/**
 * 블로그 url on/off 사용 여부
 *
 * @author Taebu Moon <mtaebu@gmail.com>
 * @param string $st_no  상점아이디
 * @return array
 */
function get_blog_yn($st_no)
{
    $sql=array();
    $sql[]="select ";
    $sql[]="pv_value ";
    $sql[]="from ";
    $sql[]="prq_values ";
    $sql[]="where ";
    $sql[]="pv_code='5002' ";
    $sql[]="and pv_no='".$st_no."';";

    $str_sql=join("",$sql);
    $query = $this->db->query($str_sql);

    if ( $query->num_rows() > 0 )
    {
        //맞는 데이터가 있다면 해당 내용 반환
        $result = $query->row();
        //$result->cd_date=$result->cd_date;
        }else{
        $arrays=(object)array('pv_value'=>'off');
        $result = $arrays;
    }

    //지난 콜로그 반환
        return $result;
}