123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267 |
- <?php
- /**
- * Niushop商城系统 - 团队十年电商经验汇集巨献!
- * =========================================================
- * Copy right 2019-2029 山西牛酷信息科技有限公司, 保留所有权利。
- * ----------------------------------------------
- * 官方网址: https://www.niushop.com.cn
- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
- * 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
- * =========================================================
- */
- namespace app\admin\controller;
- use app\model\goods\Inform as InformModel;
- use app\model\goods\InformSubject as InformSubjectModel;
- use app\model\goods\InformSubjectType as InformSubjectTypeModel;
- /**
- * 商品管理 控制器
- */
- class Inform extends BaseAdmin
- {
- /**
- * 举报列表
- * @return mixed
- */
- public function lists()
- {
- if (request()->isAjax()) {
- $page = input('page', 1);
- $page_size = input('page_size', PAGE_LIST_ROWS);
- $search_text = input('search_text', '');
- $site_id = input("site_id", "");
- $state = input("state", "");
- $subject_id = input("subject_id", "");
- $condition = [];
- if ($search_text) {
- $condition[] = [ 'sku_name', 'like', '%' . $search_text . '%' ];
- }
- if (!empty($site_id)) {
- $condition[] = [ 'site_id', '=', $site_id ];
- }
- if (!empty($state)) {
- $condition[] = [ 'state', '=', $state ];
- }
- if (!empty($subject_id)) {
- $condition[] = [ 'subject_id', '=', $subject_id ];
- }
- $order = 'create_time desc';
- $field = '*';
- $inform_model = new InformModel();
- return $inform_model->getInformPageList($condition, $page, $page_size, $order, $field);
- } else {
- $this->forthMenu();
- return $this->fetch("inform/lists");
- }
- }
-
- /**
- *举报类型
- */
- public function subjecttype()
- {
- if (request()->isAjax()) {
- $page = input('page', 1);
- $page_size = input('page_size', PAGE_LIST_ROWS);
- $order = '';
- $condition = [];
- $field = '*';
- $subjecttype_model = new InformSubjectTypeModel();
- return $subjecttype_model->getSubjectTypePageList($condition, $page, $page_size, $order, $field);
- } else {
- $this->forthMenu();
- return $this->fetch("inform/subjecttype");
- }
- }
-
- /**
- *举报主题
- */
- public function subject()
- {
- if (request()->isAjax()) {
- $page = input('page', 1);
- $page_size = input('page_size', PAGE_LIST_ROWS);
- $order = '';
- $condition = [];
- $field = '*';
- $subjecttype_model = new InformSubjectModel();
- return $subjecttype_model->getSubjectPageList($condition, $page, $page_size, $order, $field);
- } else {
- $this->forthMenu();
- $subjecttype_model = new InformSubjectTypeModel();
- $subjecttype = $subjecttype_model->getSubjectTypeList();
- $this->assign("list", $subjecttype['data']);
- return $this->fetch("inform/subject");
- }
- }
-
- /**举报类型添加
- * @return mixed
- */
- public function subjecttypeadd()
- {
- if (request()->isAjax()) {
- $data = [
- 'type_name' => input('type_name', ''),
- 'type_desc' => input('type_desc', ''),
- ];
- $type_model = new InformSubjectTypeModel();
- return $type_model->addSubjectType($data);
- } else {
- return $this->fetch("inform/subjecttypeadd");
- }
- }
-
- /**举报主题添加
- * @return mixed
- */
- public function subjectadd()
- {
- if (request()->isAjax()) {
- $data = [
- 'subject_content' => input('subject_content', ''),
- 'subject_type_id' => input('subject_type_id', ''),
- 'subject_type_name' => input('type_name', ''),
- ];
- $type_model = new InformSubjectModel();
- return $type_model->addSubject($data);
- } else {
- $subjecttype_model = new InformSubjectTypeModel();
- $subjecttype = $subjecttype_model->getSubjectTypeList();
- $this->assign("typeid", $subjecttype['data']);
- return $this->fetch("inform/subjectadd");
- }
- }
-
- /**删除举报主题
- * @return mixed
- */
- public function deletesubject()
- {
- if (request()->isAjax()) {
- $subject_id = input('subject_id', 0);
- $gift_model = new InformSubjectModel();
- return $gift_model->deleteSubject([ [ 'subject_id', '=', $subject_id ] ]);
- }
- }
-
- /**删除举报类型
- * @return mixed
- */
- public function deletesubjecttype()
- {
- if (request()->isAjax()) {
- $type_id = input('type_id', 0);
- $gift_model = new InformSubjectTypeModel();
- return $gift_model->deleteSubjectType([ [ 'type_id', '=', $type_id ] ]);
- }
- }
-
- /**举报详情
- * @return mixed
- */
- public function detail()
- {
- if (request()->isAjax()) {
- $inform_id = input('inform_id', 0);
- $order_model = new InformModel();
- $order_info = $order_model->getInformInfo([ [ 'inform_id', '=', $inform_id ] ]);
- return $order_info;
- }
-
- }
-
- /**举报类型详情
- * @return mixed
- */
- public function subjecttypeinfo()
- {
- if (request()->isAjax()) {
- $type_id = input('type_id', 0);
- $type_model = new InformSubjectTypeModel();
- $type_info = $type_model->getSubjectTypeInfo([ [ 'type_id', '=', $type_id ] ]);
-
- return $type_info;
- }
-
- }
-
- /**举报类型编辑
- * @return mixed
- */
- public function editsubjecttype()
- {
- if (request()->isAjax()) {
- $type_id = input('type_id', 0);
- $data = [
- 'type_name' => input('type_name', ''),
- 'type_desc' => input('type_desc', ''),
- 'type_id' => $type_id,
- ];
- $subject_type_model = new InformSubjectTypeModel();
- return $subject_type_model->editSubjectType($data);
- }
- }
-
- /**举报主题详情
- * @return mixed
- */
- public function subjectinfo()
- {
- if (request()->isAjax()) {
- $subject_id = input('subject_id', '');
- $subject_model = new InformSubjectModel();
- $subject_info = $subject_model->getSubjectInfo([ [ 'subject_id', '=', $subject_id ] ]);
-
- $subjecttype_model = new InformSubjectTypeModel();
- $subjecttype = $subjecttype_model->getSubjectTypeList();
-
- $data = [
- 'typeid' => $subjecttype['data'],
- 'subject_type_id' => $subject_info['data']['subject_type_id'],
- 'subject_info' => $subject_info['data']['subject_content']
- ];
- return $data;
- }
- }
-
- /**举报主题编辑
- * @return mixed
- */
- public function editsubject()
- {
- if (request()->isAjax()) {
- $subject_id = input('subject_id', 0);
- $data = [
- 'subject_content' => input('subject_content', ''),
- 'subject_type_name' => input('subject_type_name', ''),
- 'subject_state' => input('subject_state', ''),
- 'subject_id' => $subject_id,
- ];
- $subject_type_model = new InformSubjectModel();
- return $subject_type_model->editSubject($data);
- }
- }
-
- /**
- * 举报处理
- */
- public function editinform()
- {
- if (request()->isAjax()) {
- $inform_id = input('inform_id', 0);
- $data = [
- 'state' => input('state', '1'),
- 'deal_time' => time(),
- 'deal_content' => input('deal_content', ''),
- 'inform_id' => $inform_id,
- ];
- $subject_type_model = new InformModel();
- return $subject_type_model->editInform($data);
- }
- }
-
- }
|