테스트 사이트 - 개발 중인 베타 버전입니다

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

· 7년 전 · 6835 · 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개

감사합니다.
감사합니다.
소스삽입이나..하나의 파일로 만들고 include로 관리자의 주문내역 리스트페이지에 넣으면 되지 않을까요..
아니면 항상 관리자페이지 접속시에 적용이 되도록 처리를 하면 될것 같습니다.
감사합니다!
ct_time 으로 하면 배송일로부터 7일이 아니라 구매일로부터 7일이 되지 않나요?? 저도 이 기능을 만들고 싶은데 DB에 배송시작일로 지정할만한 컬럼이 없어서 고민중이에요ㅠ
감사요
이걸 어디다 적용해야할까요 ? 그리고 혹시 배송일로부터 7일 을 적용하고싶으면.
ct_time 을 - > od_invoice_time 이렇게 수정하면되지않을까요 ?
4년 전
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']}' "); // 카트테이블
}


이렇게 가 맞나요 ?

게시글 목록

번호 제목
1291
1283
1274
1264
1261
1258
1255
1247
1244
1237
1232
1220
1213
1202
1195
1192
1191
1182
1169
1160
1158
1156
1154
1152
1136
1129
1122
1112
1084
1074