|
@@ -46,14 +46,6 @@ class Content extends Core
|
|
$time = Dever::maketime('2019-01-29 14:44:30');
|
|
$time = Dever::maketime('2019-01-29 14:44:30');
|
|
if ($data) {
|
|
if ($data) {
|
|
foreach ($data as $k => $v) {
|
|
foreach ($data as $k => $v) {
|
|
- echo date('Y-m-d H:i:s', $time);
|
|
|
|
- echo "\r\n";
|
|
|
|
- echo date('Y-m-d H:i:s', $v['cdate']);
|
|
|
|
- echo "\r\n";
|
|
|
|
- echo $v['cdate'] < $time;
|
|
|
|
- echo "\r\n";
|
|
|
|
- echo isset($id[$v['buy_id']]);
|
|
|
|
- echo "\r\n";
|
|
|
|
if ($v['cdate'] < $time && isset($id[$v['buy_id']]) && $id[$v['buy_id']]) {
|
|
if ($v['cdate'] < $time && isset($id[$v['buy_id']]) && $id[$v['buy_id']]) {
|
|
$num = $id[$v['buy_id']] - 1;
|
|
$num = $id[$v['buy_id']] - 1;
|
|
$score = $num * $info['score'];
|
|
$score = $num * $info['score'];
|
|
@@ -63,21 +55,29 @@ class Content extends Core
|
|
$update['where_id'] = $user['id'];
|
|
$update['where_id'] = $user['id'];
|
|
$update['score'] = $user['score'] + $score;
|
|
$update['score'] = $user['score'] + $score;
|
|
|
|
|
|
- print_r($update);
|
|
|
|
- print_r($v);die;
|
|
|
|
- if ($v['type'] == 1) {
|
|
|
|
- Dever::score($v['uid'], 'buy_journal', '购买小刊', 'act/lib/score.submit?method=pay&type=4&id=' . $v['product_id'], $score, false);
|
|
|
|
- } elseif ($v['type'] == 3) {
|
|
|
|
|
|
+
|
|
|
|
+ //$user_log = Dever::db('score/user_log')->one(array('uid' => $v['uid'], 'num' => $score, 'status' => 1));
|
|
|
|
+ $user_log = false;
|
|
|
|
+
|
|
|
|
+ if (!$user_log) {
|
|
|
|
+ if ($v['type'] == 1) {
|
|
|
|
+ Dever::score($v['uid'], 'buy_journal', '购买小刊', 'act/lib/score.submit?method=pay&type=4&id=' . $v['product_id'], $score, false);
|
|
|
|
+ } elseif ($v['type'] == 3) {
|
|
|
|
|
|
- $w['type'] = 2;
|
|
|
|
- $w['code'] = $v['code'];
|
|
|
|
- $w['status'] = 2;
|
|
|
|
- $o = Dever::db('journal/order')->one($w);
|
|
|
|
|
|
+ $w['type'] = 2;
|
|
|
|
+ $w['code'] = $v['code'];
|
|
|
|
+ $w['status'] = 2;
|
|
|
|
+ $o = Dever::db('journal/order')->one($w);
|
|
|
|
|
|
- if ($o) {
|
|
|
|
- Dever::score($o['uid'], 'dh_journal', '兑换小刊', 'act/lib/score.submit?method=code&type=4&id=' . $o['product_id'], $score, false);
|
|
|
|
|
|
+ if ($o) {
|
|
|
|
+ Dever::score($o['uid'], 'dh_journal', '兑换小刊', 'act/lib/score.submit?method=code&type=4&id=' . $o['product_id'], $score, false);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ print_r($user_log);
|
|
|
|
+
|
|
|
|
+ print_r($update);
|
|
|
|
+ print_r($v);die;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|