diff --git a/app/api/model/Article.php b/app/api/model/Article.php index 46df1857..55c0d1f6 100644 --- a/app/api/model/Article.php +++ b/app/api/model/Article.php @@ -88,8 +88,7 @@ class Article extends ArticleModel $filter[] = ['title', 'like', "%$title%"]; } // 获取列表数据 - $list = $this->withoutField(['content']) - ->where($filter) + $list = $this->where($filter) ->where('status', '=', 1) ->where('is_delete', '=', 0) ->order(['sort' => 'asc', 'create_time' => 'desc']) diff --git a/app/common/model/invite/InviteConfig.php b/app/common/model/invite/InviteConfig.php new file mode 100644 index 00000000..76518981 --- /dev/null +++ b/app/common/model/invite/InviteConfig.php @@ -0,0 +1,52 @@ +where(['store_id' => self::$storeId])->exists()) { + return $this->save($data) !== false; + } + $data['store_id'] = self::$storeId; + return $this->save($data); + } + + /** + * @notes:新增 + * @param $data + * @return bool + * @author: wanghousheng + */ + public function add($data): bool + { + $data['store_id'] = self::$storeId; + return $this->save($data); + } + + /** + * 详情 + * @param array $where + * @return static|array|null + */ + public static function detail(array $where = []) + { + return self::get($where); + } + +} \ No newline at end of file diff --git a/app/common/model/invite/InviteLog.php b/app/common/model/invite/InviteLog.php new file mode 100644 index 00000000..e17ec1ec --- /dev/null +++ b/app/common/model/invite/InviteLog.php @@ -0,0 +1,56 @@ +hasOne(User::class, 'user_id', 'user_id'); + } + + public function invitee(): HasOne + { + return $this->hasOne(User::class, 'user_id', 'invitee_user_id'); + } + + /** + * @notes:新增 + * @param $data + * @return bool + * @author: wanghousheng + */ + public function add($data): bool + { + $data['store_id'] = self::$storeId; + return $this->save($data); + } + + /** + * 详情 + * @param array $where + * @return static|array|null + */ + public static function detail(array $where) + { + return self::get($where); + } + +} \ No newline at end of file diff --git a/app/store/controller/Invite.php b/app/store/controller/Invite.php new file mode 100644 index 00000000..47b3257c --- /dev/null +++ b/app/store/controller/Invite.php @@ -0,0 +1,35 @@ +renderSuccess(compact('info')); + } + + public function editConfig() + { + $id = + $info = InviteConfig::detail(); + $data = $this->postForm(); + if (!$data) { + return $this->renderError('缺少必要参数'); + } + $model = ServerCategory::detail($categoryId); + if ($model->edit($data)) { + return $this->renderSuccess('编辑成功'); + } + return $this->renderError($model->getError() ?: '编辑失败'); + } +} \ No newline at end of file