|
@@ -112,6 +112,10 @@ class Cron
|
|
|
} else {
|
|
|
$method = 'day';
|
|
|
}
|
|
|
+ $table = 'cash/' . $type;
|
|
|
+ if ($type == 'shop_sell') {
|
|
|
+ $type = 'shop';
|
|
|
+ }
|
|
|
|
|
|
list($start, $end) = Dever::$method($num);
|
|
|
|
|
@@ -123,7 +127,7 @@ class Cron
|
|
|
$data['type'] = $info['stat_type'];
|
|
|
$data['day'] = $start;
|
|
|
$data['t'] = $k;
|
|
|
- $find = Dever::db('cash/' . $type)->find($data);
|
|
|
+ $find = Dever::db($table)->find($data);
|
|
|
if ($type == 'factory') {
|
|
|
$msg_type = 4;
|
|
|
$cash = Dever::db('cash/order')->getPCash($where);
|
|
@@ -139,10 +143,10 @@ class Cron
|
|
|
$data['start'] = $start;
|
|
|
$data['end'] = $end;
|
|
|
if (!$find) {
|
|
|
- $id = Dever::db('cash/' . $type)->insert($data);
|
|
|
+ $id = Dever::db($table)->insert($data);
|
|
|
} else {
|
|
|
$id = $data['where_id'] = $find['id'];
|
|
|
- Dever::db('cash/' . $type)->update($data);
|
|
|
+ Dever::db($table)->update($data);
|
|
|
}
|
|
|
|
|
|
if ($id > 0 && $type == 'store') {
|
|
@@ -159,7 +163,7 @@ class Cron
|
|
|
$data['cash'] += $up['cash'];
|
|
|
$data['num'] += $up['num'];
|
|
|
$data['where_id'] = $id;
|
|
|
- Dever::db('cash/' . $type)->update($data);
|
|
|
+ Dever::db($table)->update($data);
|
|
|
}
|
|
|
|
|
|
if (($type == 'factory' || $type == 'store') && Dever::project('message') && $id) {
|