123456789101112131415161718192021222324252627282930313233343536 |
- <?php
- namespace Audit\Lib;
- use Dever;
- class Core
- {
- public function audit($id, $name, $data)
- {
- $audit = Dever::param('audit', $data);
- $info = Dever::db('audit/data')->one($id);
- $table = Dever::config('base')->type_table[$info['type']];
- $source = Dever::db($table)->one($info['data_id']);
- if ($source && $source['audit'] != $audit) {
- Dever::config('base')->after = false;
- Dever::db($table)->update(array('where_id' => $info['data_id'], 'audit' => $audit));
- }
- }
- public function status($id, $name, $data)
- {
- $status = Dever::param('status', $data);
- $info = Dever::db('audit/data')->one($id);
- $table = Dever::config('base')->type_table[$info['type']];
- $source = Dever::db($table)->one($info['data_id']);
- if ($source && $source['status'] != $status) {
- Dever::config('base')->after = false;
- Dever::db($table)->update(array('where_id' => $info['data_id'], 'status' => $status));
- }
- }
- }
|