diff --git a/plugs/think-plugs-ticket/src/Service.php b/plugs/think-plugs-ticket/src/Service.php index 8549b45..ed3e545 100644 --- a/plugs/think-plugs-ticket/src/Service.php +++ b/plugs/think-plugs-ticket/src/Service.php @@ -21,8 +21,9 @@ class Service extends Plugin [ 'name' => '工单管理', 'subs' => [ - ['name' => '工单列表', 'icon' => 'layui-icon layui-icon-template-1', 'node' => "{$code}/ticket/index"], ['name' => '工单分类', 'icon' => 'layui-icon layui-icon-template-1', 'node' => "{$code}/type/index"], + ['name' => '随手拍列表', 'icon' => 'layui-icon layui-icon-template-1', 'node' => "{$code}/user_share/index"], + ['name' => '工单列表', 'icon' => 'layui-icon layui-icon-template-1', 'node' => "{$code}/ticket/index"], ] ] ]; diff --git a/plugs/think-plugs-ticket/src/controller/UserShare.php b/plugs/think-plugs-ticket/src/controller/UserShare.php index bcedc28..79f4559 100644 --- a/plugs/think-plugs-ticket/src/controller/UserShare.php +++ b/plugs/think-plugs-ticket/src/controller/UserShare.php @@ -2,6 +2,7 @@ namespace plugin\ticket\controller; +use plugin\ticket\model\TicketType; use plugin\ticket\model\TicketUserShare; use think\admin\Controller; use think\admin\helper\QueryHelper; @@ -14,11 +15,12 @@ class UserShare extends Controller public function index() { $this->title = '用户随手拍'; + $this->type_list = TicketType::getTypeList(); TicketUserShare::mQuery()->layTable(function () { }, function (QueryHelper $query) { - $query->like(['title|content|contact_name|ticket_address|contact_phone#keyword']) - ->dateBetween(['create_at', 'last_activity_at']) + $query->like(['title|content|ticket_address|contact_phone#keyword']) + ->dateBetween(['create_at']) ->equal(['status', 'type_id']); $query->with(['user'])->append(['imgs_arr', 'status_text', 'type_name', 'last_reply']); }); diff --git a/plugs/think-plugs-ticket/src/controller/api/auth/UserShare.php b/plugs/think-plugs-ticket/src/controller/api/auth/UserShare.php index 82642c5..5956155 100644 --- a/plugs/think-plugs-ticket/src/controller/api/auth/UserShare.php +++ b/plugs/think-plugs-ticket/src/controller/api/auth/UserShare.php @@ -40,6 +40,7 @@ class UserShare extends Auth 'ticket_address.require' => '地址不能为空', 'contact_name.default' => $this->account->user() ? $this->account->user()['nickname'] : '用户', ]); + $data['imgs'] = arr2str($data['imgs'], '|'); $data['user_id'] = $this->usid; $id = TicketUserShare::query()->insert($data, true); $this->success('添加随手拍成功', $id); diff --git a/plugs/think-plugs-ticket/src/model/TicketUserShare.php b/plugs/think-plugs-ticket/src/model/TicketUserShare.php index 2858669..b1c6b1b 100644 --- a/plugs/think-plugs-ticket/src/model/TicketUserShare.php +++ b/plugs/think-plugs-ticket/src/model/TicketUserShare.php @@ -6,5 +6,8 @@ use think\admin\Model; class TicketUserShare extends Model { - + public function getImgsArrAttr($value, $data) + { + return str2arr($data['imgs'] ?: '', '|'); + } } \ No newline at end of file diff --git a/plugs/think-plugs-ticket/src/view/user_share/index.html b/plugs/think-plugs-ticket/src/view/user_share/index.html new file mode 100644 index 0000000..a771caf --- /dev/null +++ b/plugs/think-plugs-ticket/src/view/user_share/index.html @@ -0,0 +1,61 @@ +{extend name="table"} + +{block name="button"} +{/block} + +{block name="content"} +
+
+
+
+ {include file='ticket/index_search'} +
+
+
+
+
+ +{/block} + +{block name='style'} + +{/block} + +{block name='script'} + +{/block} \ No newline at end of file diff --git a/plugs/think-plugs-ticket/src/view/user_share/index_search.html b/plugs/think-plugs-ticket/src/view/user_share/index_search.html new file mode 100644 index 0000000..ccb90db --- /dev/null +++ b/plugs/think-plugs-ticket/src/view/user_share/index_search.html @@ -0,0 +1,33 @@ +
+ 条件搜索 + + +