all(),[ 'corpid' => 'required|string' ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $corpid = $request->input('corpid'); $res = PortraitService::confList($corpid); return self::returnValue($res); } /** * 画像配置操作 * @param Request $request * @return array */ public function confOperate(Request $request) { $validator = \Validator::make($request->all(),[ 'corpid' => 'required|string', 'conf_json' => 'required|string' ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $corpid = $request->input('corpid'); $confJson = $request->input('conf_json'); list($res, $code) = PortraitService::confOperate($corpid, $confJson); return self::returnValue($res, $code); } /** * 画像配置添加属性 * @param Request $request * @return array */ public function confAdd(Request $request) { $validator = \Validator::make($request->all(),[ 'corpid' => 'required|string', 'name' => 'required|string' ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $corpid = $request->input('corpid'); $name = $request->input('name'); list($res, $code) = PortraitService::confAdd($corpid, $name); return self::returnValue($res, $code); } /** * 画像属性编辑 * @param Request $request * @return array */ public function confEdit(Request $request) { $validator = \Validator::make($request->all(),[ 'corpid' => 'required|string', 'fid' => 'required|string', 'name' => 'required|string' ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $corpid = $request->input('corpid'); $fid = $request->input('fid'); $name = $request->input('name'); list($res, $code) = PortraitService::confEdit($corpid, $fid, $name); return self::returnValue($res, $code); } /** * 客户画像编辑 * @param Request $request * @return array */ public function edit(Request $request) { $validator = \Validator::make($request->all(),[ 'corpid' => 'required|string', 'user_id' => 'required|string', 'external_userid' => 'required|string', 'attrs_json' => 'required|string' ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $corpid = $request->input('corpid'); $userId = $request->input('user_id'); $externalUserid = $request->input('external_userid'); $attrsJson = $request->input('attrs_json'); list($res, $code) = PortraitService::edit($corpid, $userId, $externalUserid, $attrsJson); return self::returnValue($res, $code); } public function h5CustomerDetail(Request $request) { $validator = \Validator::make($request->all(),[ 'corpid' => 'required', 'external_userid' => 'required|string', 'user_id' => 'required|string' ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $corpid = $request->input('corpid'); $external_userid = $request->input('external_userid'); $userId = $request->input('user_id'); list($data, $code) = PortraitService::h5CustomerDetail($corpid, $external_userid, $userId); return self::returnValue($data, $code); } public function h5CustomerDynamicList(Request $request) { $validator = \Validator::make($request->all(),[ 'corpid' => 'required', 'external_userid' => 'required|string', 'user_id' => 'required|string' ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $corpid = $request->input('corpid'); $external_userid = $request->input('external_userid'); $userId = $request->input('user_id'); $data = PortraitService::h5CustomerDynamicList($corpid, $external_userid); return self::returnValue($data); } public function h5CustomerOrderList(Request $request) { $validator = \Validator::make($request->all(),[ 'corpid' => 'required', 'external_userid' => 'required|string', 'user_id' => 'required|string', 'page' => 'required|int', 'pagesize' => 'nullable|int', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $corpid = $request->input('corpid'); $external_userid = $request->input('external_userid'); $userId = $request->input('user_id'); $page = $request->input('page', 1); $pagesize = $request->input('page_size', 20); list($data, $total) = PortraitService::h5CustomerOrderList($corpid, $external_userid, $page, $pagesize); return self::returnPageValue($data, $total, $pagesize, $page); } // 客户详情标签编辑 public function h5CustomerTagUpdate(Request $request) { $validator = \Validator::make($request->all(),[ 'corpid' => 'required', 'external_userid' => 'required|string', 'user_id' => 'required|string', 'selected_tag_id_list' => 'required|array', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $corpid = $request->input('corpid'); $externalUserId = $request->input('external_userid'); $userId = $request->input('user_id'); $selectedTagIdList = $request->input('selected_tag_id_list'); list($res, $code) = PortraitService::h5CustomerDetailTagUpdate($corpid, $externalUserId, $userId, $selectedTagIdList); return self::returnValue($res, $code); } //标签列表(按标签组分组返回) public function h5TagList(Request $request) { $validator = \Validator::make($request->all(),[ 'corpid' => 'required', ]); if ($validator->fails()) { return self::returnValue($validator->getMessageBag(), 1102); } $corpid = $request->input('corpid'); $keyword = $request->input('keyword'); $data = TagService::tagList($corpid, $keyword); return self::returnValue($data); } }