|
@@ -6,6 +6,7 @@ use addons\wechat\model\WechatCaptcha;
|
|
|
use app\admin\model\Admin;
|
|
|
use app\admin\model\cms\AuthorManuscript;
|
|
|
use app\admin\model\cms\Channel;
|
|
|
+use app\admin\model\cms\ChannelAdmin;
|
|
|
use app\admin\model\cms\Comment;
|
|
|
use app\admin\model\cms\Comments;
|
|
|
use app\admin\model\cms\InviteReviewer;
|
|
@@ -20,6 +21,7 @@ use app\common\model\Attachment;
|
|
|
use app\common\model\UserRoleContent;
|
|
|
use app\common\model\UserRoleLog;
|
|
|
use app\manytenant\model\Manytenant;
|
|
|
+use fast\Tree;
|
|
|
use think\Config;
|
|
|
use think\Cookie;
|
|
|
use think\Db;
|
|
@@ -38,6 +40,7 @@ class User extends Frontend
|
|
|
protected $noNeedLogin = ['login', 'register', 'third', 'jump'];
|
|
|
protected $noNeedRight = ['*'];
|
|
|
protected $position = 0;
|
|
|
+ protected $channelIds = [];
|
|
|
protected $model = null;
|
|
|
|
|
|
public function _initialize()
|
|
@@ -69,6 +72,16 @@ class User extends Frontend
|
|
|
Cookie::delete('token');
|
|
|
});
|
|
|
|
|
|
+ $disabledIds = [];
|
|
|
+ $parentChannelIds = Channel::where(['parent_id' => 1, 'type' => 'channel'])->column('id');
|
|
|
+ $sonChannelIds = Channel::where(['parent_id' => ['in', $parentChannelIds]])->column('id');
|
|
|
+ $channelIds = array_merge($parentChannelIds, $sonChannelIds);
|
|
|
+ $all = collection(Channel::where(['id' => ['in', $channelIds]])->order("weigh desc,id desc")->select())->toArray();
|
|
|
+
|
|
|
+ $tree = Tree::instance()->init($all, 'parent_id');
|
|
|
+ $channelOptions = $tree->getTree(1, "<option model='@model_id' value=@id @selected @disabled>@spacer@name</option>", '', $disabledIds);
|
|
|
+ $this->view->assign('channelOptions', $channelOptions);
|
|
|
+
|
|
|
// 根据不同用户展示不同字段
|
|
|
$fieldsList = \app\admin\model\workorder\Fields::where([
|
|
|
'status' => 1,
|
|
@@ -91,6 +104,17 @@ class User extends Frontend
|
|
|
$this->view->assign('fields', $this->model->getFields(null, 0));
|
|
|
}
|
|
|
|
|
|
+ function getChildren($parentId) {
|
|
|
+ $children = Channel::where(['parent_id' => $parentId, 'type' => 'channel'])->column('id');
|
|
|
+ foreach ($children as $childId) {
|
|
|
+ $grandChildren = getChildren($childId);
|
|
|
+ if ($grandChildren) {
|
|
|
+ $children = array_merge($children, $grandChildren);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return $children;
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 会员中心
|
|
|
*/
|
|
@@ -495,6 +519,16 @@ class User extends Frontend
|
|
|
$row = AuthorManuscript::where(['id' => $id])->find();
|
|
|
$row->author_content = json_decode($row->author_content, true);
|
|
|
$row->review_content = json_decode($row->review_content, true);
|
|
|
+
|
|
|
+ $disabledIds = [];
|
|
|
+ $disabledIds = array_diff($disabledIds, [$row['journal']]);
|
|
|
+ $parentChannelIds = Channel::where(['parent_id' => 1, 'type' => 'channel'])->column('id');
|
|
|
+ $sonChannelIds = Channel::where(['parent_id' => ['in', $parentChannelIds]])->column('id');
|
|
|
+ $channelIds = array_merge($parentChannelIds, $sonChannelIds);
|
|
|
+ $all = collection(Channel::where(['id' => ['in', $channelIds]])->order("weigh desc,id desc")->select())->toArray();
|
|
|
+ $tree = Tree::instance()->init($all, 'parent_id');
|
|
|
+ $channelOptions = $tree->getTree(1, "<option model='@model_id' value=@id @selected @disabled>@spacer@name</option>", $row['journal'], $disabledIds);
|
|
|
+ $this->view->assign('channelOptions', $channelOptions);
|
|
|
}
|
|
|
$this->view->assign('fields', $this->model->getFields($row, 0));
|
|
|
$this->view->assign('row', $row);
|