|
@@ -3,6 +3,7 @@
|
|
|
namespace app\admin\controller\article;
|
|
namespace app\admin\controller\article;
|
|
|
|
|
|
|
|
use app\admin\controller\AuthController;
|
|
use app\admin\controller\AuthController;
|
|
|
|
|
+use app\admin\model\system\SystemAdmin;
|
|
|
use app\admin\model\system\SystemAttachment;
|
|
use app\admin\model\system\SystemAttachment;
|
|
|
use crmeb\services\{
|
|
use crmeb\services\{
|
|
|
UtilService as Util, JsonService as Json
|
|
UtilService as Util, JsonService as Json
|
|
@@ -31,6 +32,11 @@ class Article extends AuthController
|
|
|
['title', ''],
|
|
['title', ''],
|
|
|
['cid', $this->request->param('pid', '')],
|
|
['cid', $this->request->param('pid', '')],
|
|
|
], $this->request);
|
|
], $this->request);
|
|
|
|
|
+ $admin_id=$this->adminId;
|
|
|
|
|
+ $mer_id = SystemAdmin::where('id', $admin_id)->value('mer_id');
|
|
|
|
|
+ if ($mer_id>0){
|
|
|
|
|
+ $where['mer_id'] = $mer_id;
|
|
|
|
|
+ }
|
|
|
$this->assign('where', $where);
|
|
$this->assign('where', $where);
|
|
|
$where['merchant'] = 0;//区分是管理员添加的图文显示 0 还是 商户添加的图文显示 1
|
|
$where['merchant'] = 0;//区分是管理员添加的图文显示 0 还是 商户添加的图文显示 1
|
|
|
$tree = sort_list_tier(ArticleCategoryModel::getArticleCategoryList());
|
|
$tree = sort_list_tier(ArticleCategoryModel::getArticleCategoryList());
|
|
@@ -62,6 +68,11 @@ class Article extends AuthController
|
|
|
$news['synopsis'] = '';
|
|
$news['synopsis'] = '';
|
|
|
$news['url'] = '';
|
|
$news['url'] = '';
|
|
|
$news['cid'] = [];
|
|
$news['cid'] = [];
|
|
|
|
|
+ $admin_id=$this->adminId;
|
|
|
|
|
+ $mer_id = SystemAdmin::where('id', $admin_id)->value('mer_id');
|
|
|
|
|
+ if ($mer_id>0){
|
|
|
|
|
+ $news['mer_id'] = $mer_id;
|
|
|
|
|
+ }
|
|
|
$select = 0;
|
|
$select = 0;
|
|
|
if ($id) {
|
|
if ($id) {
|
|
|
$news = ArticleModel::where('n.id', $id)->alias('n')->field('n.*,c.content')->join('ArticleContent c', 'c.nid=n.id', 'left')->find();
|
|
$news = ArticleModel::where('n.id', $id)->alias('n')->field('n.*,c.content')->join('ArticleContent c', 'c.nid=n.id', 'left')->find();
|
|
@@ -122,6 +133,8 @@ class Article extends AuthController
|
|
|
$data['cid'] = implode(',', $data['cid']);
|
|
$data['cid'] = implode(',', $data['cid']);
|
|
|
$content = $data['content'];
|
|
$content = $data['content'];
|
|
|
unset($data['content']);
|
|
unset($data['content']);
|
|
|
|
|
+ $admin_id = $this->request->param('admin_id');
|
|
|
|
|
+ $data['mer_id'] = SystemAdmin::where('id', $admin_id)->value('mer_id');
|
|
|
if ($data['id']) {
|
|
if ($data['id']) {
|
|
|
$id = $data['id'];
|
|
$id = $data['id'];
|
|
|
unset($data['id']);
|
|
unset($data['id']);
|