Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iwl-live
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Anthony.Suerte
iwl-live
Commits
ea88fdba
Commit
ea88fdba
authored
Mar 09, 2022
by
Antonio.Suerte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
User Update Notifier Integration
parent
f07f5c52
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
75 additions
and
6 deletions
+75
-6
logic.php
logic/setting/logic.php
+75
-6
No files found.
logic/setting/logic.php
View file @
ea88fdba
...
...
@@ -49,7 +49,6 @@ class LogicSetting extends SettingModelClass {
if
(
$this
->
getAction
()
==
NO_STRING
&&
$this
->
getType
()
==
TYPE_COMPLETE
)
{
// プロフィール登録
$this
->
updateProfile
();
}
else
if
(
$this
->
getAction
()
==
CONTROL_SETTING_KYC
&&
$this
->
getType
()
==
TYPE_SAVE
)
{
// KYC登録(個人)
$this
->
load
();
...
...
@@ -158,7 +157,12 @@ class LogicSetting extends SettingModelClass {
$params
=
$this
->
getUpdateDataProfile
();
// データの登録
$this
->
accessModify
(
'UPDATE_USER_PROFILE'
,
$params
);
$userUpdate
=
$this
->
accessModify
(
'UPDATE_USER_PROFILE'
,
$params
);
if
(
!
$userUpdate
)
return
;
$this
->
notifyChangesToSlack
(
$row
,
$params
);
// 旧データの取得
$sendParams
[]
=
$params
[
NO_COUNT
];
// 口座番号
...
...
@@ -178,7 +182,6 @@ class LogicSetting extends SettingModelClass {
$sendParams
[]
=
$this
->
getColumnData
(
$row
,
COLUMN_ZIP_CODE
);
// 郵便番号
$sendParams
[]
=
$this
->
getColumnData
(
$row
,
COLUMN_TEL
);
// 電話番号
// CRM連携(更新)
$this
->
crmUpdateRecords
(
$this
->
getUpdateDataCRM
());
...
...
@@ -196,6 +199,72 @@ class LogicSetting extends SettingModelClass {
,
VAR_NOTICE_MAIL_ADDRESS
);
}
private
function
notifyChangesToSlack
(
$previous
,
$changes
){
$changes
=
[
"Country"
=>
[
"old"
=>
$previous
[
PARAM_COUNTRY
],
"new"
=>
$changes
[
VAL_INT_7
]
],
"State"
=>
[
"old"
=>
$previous
[
PARAM_STATE
],
"new"
=>
$changes
[
VAL_INT_1
]
],
"City"
=>
[
"old"
=>
$previous
[
PARAM_CITY
],
"new"
=>
$changes
[
VAL_INT_2
]
],
"Address"
=>
[
"old"
=>
$previous
[
PARAM_ADDRESS
],
"new"
=>
$changes
[
VAL_INT_4
]
],
"Zip Code"
=>
[
"old"
=>
$previous
[
PARAM_ZIP_CODE
],
"new"
=>
$changes
[
VAL_INT_3
]
],
"Tel. No"
=>
[
"old"
=>
$previous
[
PARAM_TEL
],
"new"
=>
$changes
[
VAL_INT_6
]
]
];
$fullName
=
"
{
$previous
[
PARAM_FIRST_NAME
]
}
{
$previous
[
PARAM_LAST_NAME
]
}
"
;
$updateDetails
=
"User-Profile Updated: (
{
$fullName
}
-
{
$previous
[
PARAM_USER_ACCOUNT
]
}
)
\n\n
"
;
foreach
(
$changes
as
$key
=>
$change
){
$indication
=
(
$change
[
"old"
]
==
$change
[
"new"
]
?
"Same"
:
"
{
$change
[
"old"
]
}
->
{
$change
[
"new"
]
}
"
);
$updateDetails
.=
"
{
$key
}
:
{
$indication
}
\n
"
;
}
$message
=
[
"text"
=>
$updateDetails
];
$slackChannels
=
$this
->
getSettingConfiguration
(
"slack_notif_channel"
);
$handle
=
curl_init
();
curl_setopt_array
(
$handle
,
[
CURLOPT_URL
=>
$slackChannels
->
user_details_channel
,
CURLOPT_RETURNTRANSFER
=>
true
,
CURLOPT_FOLLOWLOCATION
=>
true
,
CURLOPT_ENCODING
=>
"utf8"
,
CURLOPT_HTTP_VERSION
=>
CURL_HTTP_VERSION_1_1
,
CURLOPT_POSTFIELDS
=>
json_encode
(
$message
),
CURLOPT_CUSTOMREQUEST
=>
"POST"
,
CURLOPT_HTTPHEADER
=>
[
"Content-type: application/json"
,
]
]);
curl_exec
(
$handle
);
if
(
$err
=
curl_error
(
$handle
))
echo
$err
;
curl_close
(
$handle
);
}
/*-------------------------------------------------------------------------
* @function_name: ユーザプロフィール画像のアップロード
* @parameter : なし
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment