|
@@ -17,7 +17,7 @@ class Core
|
|
|
if (isset($param['state']) && $param['state'] == 2) {
|
|
|
$delete = true;
|
|
|
}
|
|
|
- $info = Dever::db('component/' . $this->table)->one($id);
|
|
|
+ $info = Dever::db($this->table)->one($id);
|
|
|
if (!$info) {
|
|
|
return;
|
|
|
}
|
|
@@ -65,7 +65,7 @@ class Core
|
|
|
{
|
|
|
$send = json_decode(base64_decode(Dever::input('param')), true);
|
|
|
if (isset($send['o']) && $send['o'] > 0 && isset($send['i']) && $send['i'] > 0) {
|
|
|
- $table = 'component/' . $send['t'];
|
|
|
+ $table = $send['t'];
|
|
|
$info = Dever::db($table)->one($send['i']);
|
|
|
$wechat = new Wechat($info['project_id'], 'component');
|
|
|
$oauth = $wechat->oauth($send['o']);
|
|
@@ -82,7 +82,7 @@ class Core
|
|
|
public function log($table, $user, $info, $result, $method, $param)
|
|
|
{
|
|
|
print_r($result);
|
|
|
- if ($table == 'component/version') {
|
|
|
+ if ($table == 'component_applet/version') {
|
|
|
$insert['user_id'] = $user;
|
|
|
$insert['name'] = $info['name'];
|
|
|
$insert['template_id'] = $info['template_id'];
|
|
@@ -90,7 +90,7 @@ class Core
|
|
|
$insert['version_id'] = $info['id'];
|
|
|
$insert['result'] = json_encode($result);
|
|
|
Dever::db($table . '_log')->insert($insert);
|
|
|
- } elseif ($table == 'component/auditing') {
|
|
|
+ } elseif ($table == 'component_applet/auditing') {
|
|
|
if (isset($result['auditid'])) {
|
|
|
$update['auditid'] = $result['auditid'];
|
|
|
}
|
|
@@ -98,7 +98,7 @@ class Core
|
|
|
$update['result'] = json_encode($result);
|
|
|
$update['where_id'] = $info['id'];
|
|
|
Dever::db($table)->update($update);
|
|
|
- } elseif ($table == 'component/publish' || $table == 'component/revert' || $table == 'component/unaudit') {
|
|
|
+ } elseif ($table == 'component_applet/publish' || $table == 'component_applet/revert' || $table == 'component_applet/unaudit') {
|
|
|
if ($result['errcode'] == 0) {
|
|
|
$update['status'] = 2;
|
|
|
} else {
|
|
@@ -109,16 +109,16 @@ class Core
|
|
|
$update['where_id'] = $info['id'];
|
|
|
Dever::db($table)->update($update);
|
|
|
|
|
|
- if ($table == 'component/unaudit' && $update['status'] == 2) {
|
|
|
+ if ($table == 'component_applet/unaudit' && $update['status'] == 2) {
|
|
|
$audit = array('option_user_id' => $info['user_id'], 'option_project_id' => $info['project_id'], 'option_version_id' => $info['version_id'], 'option_status' => 1);
|
|
|
- $audit = Dever::db('component/auditing')->all($audit);
|
|
|
+ $audit = Dever::db('component_applet/auditing')->all($audit);
|
|
|
if ($audit) {
|
|
|
foreach ($audit as $k => $v) {
|
|
|
$update = array();
|
|
|
$update['set_status'] = 3;
|
|
|
$update['set_statusDesc'] = '撤回';
|
|
|
$update['where_id'] = $v['id'];
|
|
|
- Dever::db('component/auditing')->update($update);
|
|
|
+ Dever::db('component_applet/auditing')->update($update);
|
|
|
}
|
|
|
}
|
|
|
}
|