修复问题

This commit is contained in:
zyx0814
2024-05-03 20:51:24 +08:00
Unverified
parent bd7b44b7bc
commit 5f3d1d6adb
4 changed files with 28 additions and 12 deletions

View File

@@ -415,7 +415,7 @@ if ($_GET['step'] == 'start') {
];
foreach ($cornarr as $v) {
if (DB::result_first("select cronid from %t where filename = %s", array('cron', $v['filename']))) {
if (!DB::result_first("select cronid from %t where filename = %s", array('cron', $v['filename']))) {
DB::insert('cron', $v);
}
}

View File

@@ -22,11 +22,15 @@ if ($locked) {
}
$limit = 100;
foreach (DB::fetch_all("select * from %t where 1 limit 0,$limit ", array('ai_task')) as $v) {
if ($v['aikey'] == 'aiXh::chatImage') {
require_once DZZ_ROOT . './dzz/aiXhimage/class/xhChat.php';
$tplid = $v['tplid'];
$promptdata = C::t('#aiXhimage#ai_xhimageprompt')->fetch($tplid);
if (!$promptdata) continue;
if (!$promptdata){
C::t('ai_task')->delete($v['id']);
continue;
}
$getType = $promptdata['cate'];
if ($promptdata['cate'] == 1) {
$question = $promptdata['prompt'] . '。返回结果的格式为“标签1,标签2,标签3”其中标签之间使用逗号分割。';
@@ -40,6 +44,7 @@ foreach (DB::fetch_all("select * from %t where 1 limit 0,$limit ", array('ai_tas
C::t('ai_task')->delete($v['id']);
continue;
}
$imgurl = FALSE;
$thumbdata = DB::fetch_first("select * from %t where rid =%s", array('thumb_record', $rid));
if ($thumbdata['sstatus']) {
@@ -56,6 +61,7 @@ foreach (DB::fetch_all("select * from %t where 1 limit 0,$limit ", array('ai_tas
if(!$metadata['aid']) $metadata['aid'] = 0;
$setarr = ['aid' => $metadata['aid'], 'rid' => $rid, 'gettype' => $getType, 'tplid' => $tplid, 'aikey' => $v['aikey']];
$cachedata = C::t('ai_imageparse')->insertData($setarr);
if ($cachedata) {
if ($cachedata['isget'] && $cachedata['data']) {
$content = $cachedata['data'];
@@ -69,8 +75,14 @@ foreach (DB::fetch_all("select * from %t where 1 limit 0,$limit ", array('ai_tas
$params['processname'] = $return;
}
$chatclinet = new xhChat();
$aireturn = $chatclinet->getApiData('aiXh::chatImage', $params);
if ($aireturn['error_msg']) return ['error' => $aireturn['error_msg']];
if ($aireturn['error_msg']){
C::t('ai_imageparse')->update($cachedata['id'], ['isget' => 1, 'data' => '']);
C::t('ai_task')->delete($v['id']);
continue;
}
if ($aireturn['result']) {
if ($aireturn['totaltoken']) {
$tokendatas = [
@@ -120,14 +132,19 @@ foreach (DB::fetch_all("select * from %t where 1 limit 0,$limit ", array('ai_tas
C::t('ai_task')->delete($v['id']);
} elseif ($getType == 2) {
$desc = getstr($content);
C::t('pichome_resources_attr')->update_by_rids($metadata['appid'], $rid, ['desc' => $desc]);
if($desc)C::t('pichome_resources_attr')->update_by_rids($metadata['appid'], $rid, ['desc' => $desc]);
C::t('ai_task')->delete($v['id']);
} elseif ($getType == 0) {
$name = trim(name_filter($content));
$name = str_replace([',','','.','。'],'',$name);
$name = getstr($name,30);
if($content){
C::t('pichome_resources')->update_by_rids($metadata['appid'], $rid, ['name' => $name.'.'.$metadata['ext']]);
}
C::t('ai_task')->delete($v['id']);
}
}

View File

@@ -43,7 +43,7 @@
try{
$return = $eagleexport->execExport($force);
}catch (Exception $e){
C::t('pichome_vapp')->update($appid,['state'=>0]);
// C::t('pichome_vapp')->update($appid,['state'=>0]);
runlog('eagleexporterror',$appid.$e->getMessage());
dzz_process::unlock($processname);
}
@@ -57,7 +57,7 @@
try{
$return = $localexport->execExport($force);
}catch (Exception $e){
C::t('pichome_vapp')->update($appid,['state'=>0]);
//C::t('pichome_vapp')->update($appid,['state'=>0]);
runlog('localexporterror',$appid.$e->getMessage());
dzz_process::unlock($processname);
}
@@ -67,7 +67,7 @@
try{
$return = $billfishxport->execExport($force);
}catch (Exception $e){
C::t('pichome_vapp')->update($appid,['state'=>0]);
// C::t('pichome_vapp')->update($appid,['state'=>0]);
runlog('billfishexporterror',$appid.$e->getMessage());
dzz_process::unlock($processname);
}

View File

@@ -24,12 +24,11 @@ if (!$data) exit(json_encode(array('error' => 'no data')));
if ($data['state'] != 3 || $data['isdelete'] > 0) exit(json_encode(array('error' => 'is deleted or state is not allow')));
if ($data['type'] == 0) {
include_once DZZ_ROOT.'dzz'.BS.'eagle'.BS.'class'.BS.'class_eagleexport.php';
//include_once dzz_libfile('eagleexport');
$eagleexport = new eagleexport($data);
try{
$return = $eagleexport->execCheckFile();
}catch (Exception $e){
C::t('pichome_vapp')->update($appid,['state'=>0]);
//C::t('pichome_vapp')->update($appid,['state'=>0]);
runlog('eagleexporterror', $appid . $e->getMessage());
dzz_process::unlock($processname);
}
@@ -41,7 +40,7 @@ if ($data['type'] == 0) {
try{
$return = $localexport->execCheckFile();
}catch (Exception $e){
C::t('pichome_vapp')->update($appid,['state'=>0]);
//C::t('pichome_vapp')->update($appid,['state'=>0]);
runlog('localexporterror', $appid . $e->getMessage());
dzz_process::unlock($processname);
}
@@ -52,7 +51,7 @@ if ($data['type'] == 0) {
try{
$return = $billfishxport->execCheckFile();
}catch (Exception $e){
C::t('pichome_vapp')->update($appid,['state'=>0]);
//C::t('pichome_vapp')->update($appid,['state'=>0]);
runlog('billfishexporterror', $appid . $e->getMessage());
dzz_process::unlock($processname);
}