群创建 代码优化
This commit is contained in:
@@ -248,7 +248,7 @@ class WorkbenchController extends Controller
|
||||
if (!empty($item->momentsSync)) {
|
||||
$item->config = $item->momentsSync;
|
||||
$item->config->devices = json_decode($item->config->devices, true);
|
||||
$item->config->contentLibraries = json_decode($item->config->contentLibraries, true);
|
||||
$item->config->contentGroups = json_decode($item->config->contentLibraries, true);
|
||||
//同步记录
|
||||
$sendNum = Db::name('workbench_moments_sync_item')->where(['workbenchId' => $item->id])->count();
|
||||
$item->syncCount = $sendNum;
|
||||
@@ -257,15 +257,14 @@ class WorkbenchController extends Controller
|
||||
|
||||
|
||||
// 获取内容库名称
|
||||
if (!empty($item->config->contentLibraries)) {
|
||||
$libraryNames = ContentLibrary::whereIn('id', $item->config->contentLibraries)
|
||||
->column('name');
|
||||
$item->config->contentLibraryNames = $libraryNames;
|
||||
if (!empty($item->config->contentGroups)) {
|
||||
$libraryNames = ContentLibrary::where('id', 'in', $item->config->contentGroups)->select();
|
||||
$item->config->contentGroupsOptions = $libraryNames;
|
||||
} else {
|
||||
$item->config->contentLibraryNames = [];
|
||||
$item->config->contentGroupsOptions = [];
|
||||
}
|
||||
}
|
||||
unset($item->momentsSync, $item->moments_sync);
|
||||
unset($item->momentsSync, $item->moments_sync,$item->config->contentLibraries);
|
||||
break;
|
||||
case self::TYPE_GROUP_PUSH:
|
||||
if (!empty($item->groupPush)) {
|
||||
|
||||
Reference in New Issue
Block a user