7일후 자동 배송 완료로 넘기기

· 2018-08-27 (월) 23:52:10 · 7760 · 18
// 자동 배송완료 만들기
$beforedays = date("Y-m-d H:i:s", ( time() - (86400 * (int)$default['de_point_days']) ) ); // 86400초는 하루
$sql22 = " select * from {$g5['g5_shop_cart_table']} where ct_status = '배송' and ct_time <= '$beforedays' ";

$result22 = sql_query($sql22);
for ($i=0; $row22=sql_fetch_array($result22); $i++) {

/*
echo "update {$g5['g5_shop_cart_table']} set ct_status = '완료' where ct_id = '{$row22['ct_id']}' ";
echo "<br>";
echo "update {$g5['g5_shop_order_table']} set od_status = '완료' where od_id = '{$row22['od_id']}' ";
echo "<br>";echo "<br>";
*/
sql_query("update {$g5['g5_shop_cart_table']} set ct_status = '완료' where ct_id = '{$row22['ct_id']}' "); // 오더테이블
sql_query("update {$g5['g5_shop_order_table']} set od_status = '완료' where od_id = '{$row22['od_id']}' "); // 카트테이블
}



허접하지만......그래도.....-_-;
|

댓글 18개

2018-08-28 (화) 09:17:52
공개해주셔서 감사합니다.
2018-08-29 (수) 05:26:36
감사요
공개감사합니다!
맨 첫번째 쿼리에서 ct_status = '완료' -> ct_status = '배송' 이어야 하지 않을까요?
감사합니다 ㅋㅋ 안그래도 안되었었네요 ㅋㅋ
바꿨습니다.
감사합니다
2018-09-19 (수) 16:36:37
어디에 어떻게 적용해야 할까요?
이걸 어디에 넣어야 할까요??
어디다 넣어야 하나요 ..??
감사합니다요~~^^
감사합니다.
감사합니다.
소스삽입이나..하나의 파일로 만들고 include로 관리자의 주문내역 리스트페이지에 넣으면 되지 않을까요..
아니면 항상 관리자페이지 접속시에 적용이 되도록 처리를 하면 될것 같습니다.
감사합니다!
ct_time 으로 하면 배송일로부터 7일이 아니라 구매일로부터 7일이 되지 않나요?? 저도 이 기능을 만들고 싶은데 DB에 배송시작일로 지정할만한 컬럼이 없어서 고민중이에요ㅠ
감사요
이걸 어디다 적용해야할까요 ? 그리고 혹시 배송일로부터 7일 을 적용하고싶으면.
ct_time 을 - > od_invoice_time 이렇게 수정하면되지않을까요 ?
2021-04-22 (목) 13:33:30
update {$g5['g5_shop_cart_table']} A inner join {$g5['g5_shop_order_table']} B using( od_id)
set A.ct_status = '완료', B.od_status = '완료' where A.ct_time < now() - interval 7 day and A.ct_status='배송'
@엑스엠엘

// 자동 배송완료 만들기
$beforedays = date("Y-m-d H:i:s", ( time() - (86400 * (int)$default['de_point_days']) ) ); // 86400초는 하루
$sql22 = " select * from update {$g5['g5_shop_cart_table']} A inner join {$g5['g5_shop_order_table']} B using( od_id)
set A.ct_status = '완료', B.od_status = '완료' where A.ct_time < now() - interval 7 day and A.ct_status='배송' ";

$result22 = sql_query($sql22);
for ($i=0; $row22=sql_fetch_array($result22); $i++) {

/*
echo "update {$g5['g5_shop_cart_table']} set ct_status = '완료' where ct_id = '{$row22['ct_id']}' ";
echo "<br>";
echo "update {$g5['g5_shop_order_table']} set od_status = '완료' where od_id = '{$row22['od_id']}' ";
echo "<br>";echo "<br>";
*/
sql_query("update {$g5['g5_shop_cart_table']} set ct_status = '완료' where ct_id = '{$row22['ct_id']}' "); // 오더테이블
sql_query("update {$g5['g5_shop_order_table']} set od_status = '완료' where od_id = '{$row22['od_id']}' "); // 카트테이블
}


이렇게 가 맞나요 ?
댓글을 작성하시려면 로그인이 필요합니다.

영카트5 팁자료실

455건
+
제목 글쓴이 날짜 조회
18-09-03 조회 3,876
18-08-27 조회 7,761
18-08-23 조회 3,962
18-08-14 조회 4,796
18-08-07 조회 6,582
18-07-28 조회 8,988
18-07-20 조회 4,655
18-06-28 조회 4,602
18-06-22 조회 4,755
18-06-17 조회 6,286
18-06-06 조회 5,311
18-05-28 조회 6,036
18-05-01 조회 4,482
18-04-12 조회 4,491
18-04-11 조회 4,335
18-04-05 조회 8,167
18-04-03 조회 5,183
18-03-30 조회 5,970
18-03-13 조회 4,184
18-03-10 조회 4,969
18-03-08 조회 5,737
18-02-21 조회 4,260
18-01-30 조회 5,858
18-01-23 조회 1.2만
18-01-22 조회 4,687
18-01-05 조회 5,715
17-12-28 조회 5,571
17-12-24 조회 1만
17-11-22 조회 6,319
17-11-19 조회 7,477