朋友圈内容库优化
This commit is contained in:
@@ -244,9 +244,10 @@ class WorkbenchController extends Controller
|
||||
$lastTime = Db::name('workbench_moments_sync_item')->where(['workbenchId' => $item->id])->order('id DESC')->value('createTime');
|
||||
$item->lastSyncTime = !empty($lastTime) ? date('Y-m-d H:i',$lastTime) : '--';
|
||||
|
||||
|
||||
// 获取内容库名称
|
||||
if (!empty($item->config->contentLibraries)) {
|
||||
$libraryNames = ContentLibrary::where('id', 'in', $item->config->contentLibraries)
|
||||
$libraryNames = ContentLibrary::whereIn('id', $item->config->contentLibraries)
|
||||
->column('name');
|
||||
$item->config->contentLibraryNames = $libraryNames;
|
||||
} else {
|
||||
@@ -678,6 +679,18 @@ class WorkbenchController extends Controller
|
||||
case self::TYPE_MOMENTS_SYNC:
|
||||
$config = WorkbenchMomentsSync::where('workbenchId', $param['id'])->find();
|
||||
if ($config) {
|
||||
if (!empty($param['contentLibraries'])){
|
||||
foreach ($param['contentLibraries'] as $library){
|
||||
if(isset($library['id']) && !empty($library['id'])){
|
||||
$contentLibraries[] = $library['id'];
|
||||
}else{
|
||||
$contentLibraries[] = $library;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
$contentLibraries = [];
|
||||
}
|
||||
|
||||
$config->syncInterval = $param['syncInterval'];
|
||||
$config->syncCount = $param['syncCount'];
|
||||
$config->syncType = $param['syncType'];
|
||||
@@ -685,7 +698,7 @@ class WorkbenchController extends Controller
|
||||
$config->endTime = $param['endTime'];
|
||||
$config->accountType = $param['accountType'];
|
||||
$config->devices = json_encode($param['devices']);
|
||||
$config->contentLibraries = json_encode($param['contentLibraries'] ?? []);
|
||||
$config->contentLibraries = json_encode($contentLibraries);
|
||||
$config->updateTime = time();
|
||||
$config->save();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user