Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
goods
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
bp
goods
Commits
6f42d1d9
Commit
6f42d1d9
authored
Aug 27, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'colonel' of
https://git.yidian-inc.com:8021/bp/goods
into colonel
parents
5d81489c
356401b9
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
38 deletions
+46
-38
ColonelAddPointValidate.php
application/library/Validate/ColonelAddPointValidate.php
+1
-1
ColonelConfigValidate.php
application/library/Validate/ColonelConfigValidate.php
+8
-2
Colonel.php
application/modules/Marketing/controllers/Colonel.php
+3
-3
ColonelService.php
application/services/marketing/ColonelService.php
+24
-24
PindanActivityColonelConfigService.php
...services/marketing/PindanActivityColonelConfigService.php
+6
-8
UserService.php
application/services/user/UserService.php
+4
-0
No files found.
application/library/Validate/ColonelAddPoint.php
→
application/library/Validate/ColonelAddPoint
Validate
.php
View file @
6f42d1d9
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
namespace
Validate
;
namespace
Validate
;
class
ColonelAddPoint
extends
BaseValidate
class
ColonelAddPoint
Validate
extends
BaseValidate
{
{
protected
$rule
=
[
protected
$rule
=
[
'colonel_apply_id'
=>
'require'
,
'colonel_apply_id'
=>
'require'
,
...
...
application/library/Validate/ColonelConfigValidate.php
View file @
6f42d1d9
...
@@ -10,12 +10,18 @@ class ColonelConfigValidate extends BaseValidate
...
@@ -10,12 +10,18 @@ class ColonelConfigValidate extends BaseValidate
];
];
protected
$message
=
[
protected
$message
=
[
'phone'
=>
'date 参数不能为空'
,
'date'
=>
'date 参数不能为空'
,
'config'
=>
'config 参数不能为空'
'config'
=>
'config 参数不能为空'
,
'marketing_id'
=>
'marketing_id 参数不能为空'
,
];
];
public
function
sceneDate
()
public
function
sceneDate
()
{
{
return
$this
->
only
([
"date"
])
->
append
(
"date"
,
"require"
);
return
$this
->
only
([
"date"
])
->
append
(
"date"
,
"require"
);
}
}
public
function
sceneAdd
()
{
return
$this
->
only
([
"date"
,
"config"
,
"marketing_id"
])
->
append
(
"marketing_id"
,
"require"
);
}
}
}
\ No newline at end of file
application/modules/Marketing/controllers/Colonel.php
View file @
6f42d1d9
...
@@ -11,7 +11,7 @@ use \Validate\ColonelApplyValidate;
...
@@ -11,7 +11,7 @@ use \Validate\ColonelApplyValidate;
use
\Validate\ColonelConfigValidate
;
use
\Validate\ColonelConfigValidate
;
use
\Validate\ColonelAuditValidate
;
use
\Validate\ColonelAuditValidate
;
use
\Validate\ColonelCenterValidate
;
use
\Validate\ColonelCenterValidate
;
use
\Validate\ColonelAddPoint
;
use
\Validate\ColonelAddPoint
Validate
;
use
\App\Services\marketing\PindanActivityColonelConfigService
;
use
\App\Services\marketing\PindanActivityColonelConfigService
;
use
\App\Services\marketing\PindanActivityInviteOrderService
;
use
\App\Services\marketing\PindanActivityInviteOrderService
;
use
\App\Services\user\UserService
;
use
\App\Services\user\UserService
;
...
@@ -55,7 +55,7 @@ class ColonelController extends Base
...
@@ -55,7 +55,7 @@ class ColonelController extends Base
*/
*/
public
function
add_configAction
()
public
function
add_configAction
()
{
{
(
new
ColonelConfigValidate
())
->
validate
();
(
new
ColonelConfigValidate
())
->
scene
(
'add'
)
->
validate
();
$params
=
$this
->
params
;
$params
=
$this
->
params
;
PindanActivityColonelConfigService
::
editColonelConfig
(
$params
);
PindanActivityColonelConfigService
::
editColonelConfig
(
$params
);
...
@@ -135,7 +135,7 @@ class ColonelController extends Base
...
@@ -135,7 +135,7 @@ class ColonelController extends Base
public
function
manage_add_apply_pointAction
()
public
function
manage_add_apply_pointAction
()
{
{
$params
=
$this
->
params
;
$params
=
$this
->
params
;
(
new
ColonelAddPoint
())
->
validate
();
(
new
ColonelAddPoint
Validate
())
->
validate
();
$takePlaceId
=
ColonelService
::
handleAddTaskPlace
(
$params
);
$takePlaceId
=
ColonelService
::
handleAddTaskPlace
(
$params
);
return
$this
->
success
([
'result'
=>
[
'take_place_id'
=>
$takePlaceId
]]);
return
$this
->
success
([
'result'
=>
[
'take_place_id'
=>
$takePlaceId
]]);
}
}
...
...
application/services/marketing/ColonelService.php
View file @
6f42d1d9
...
@@ -30,19 +30,19 @@ class ColonelService
...
@@ -30,19 +30,19 @@ class ColonelService
throw
new
MarketingException
(
MarketingException
::
COLONEL_APPLY_EXIST
);
throw
new
MarketingException
(
MarketingException
::
COLONEL_APPLY_EXIST
);
}
}
$colonelData
=
[
$colonelData
=
[
'user_id'
=>
$params
[
'user_id'
],
'user_id'
=>
$params
[
'user_id'
],
'life_account_id'
=>
MarketingService
::
getPublicLifeAccountId
(),
'life_account_id'
=>
MarketingService
::
getPublicLifeAccountId
(),
'phone'
=>
$params
[
'phone'
],
'phone'
=>
$params
[
'phone'
],
'contact_name'
=>
$params
[
'contact_name'
],
'contact_name'
=>
$params
[
'contact_name'
],
'take_place_name'
=>
$params
[
'take_place_name'
],
'take_place_name'
=>
$params
[
'take_place_name'
],
'take_place_pic'
=>
$params
[
'take_place_pic'
]
??
''
,
'take_place_pic'
=>
$params
[
'take_place_pic'
]
??
''
,
'longitude'
=>
$params
[
'longitude'
]
??
0
,
'longitude'
=>
$params
[
'longitude'
]
??
0
,
'latitude'
=>
$params
[
'latitude'
]
??
0
,
'latitude'
=>
$params
[
'latitude'
]
??
0
,
'location'
=>
$params
[
'location'
]
??
''
,
'location'
=>
$params
[
'location'
]
??
''
,
'address'
=>
$params
[
'address'
]
??
''
,
'address'
=>
$params
[
'address'
]
??
''
,
'province'
=>
$params
[
'province'
]
??
''
,
'province'
=>
$params
[
'province'
]
??
''
,
'city'
=>
$params
[
'city'
]
??
''
,
'city'
=>
$params
[
'city'
]
??
''
,
'area'
=>
$params
[
'area'
]
??
''
,
'area'
=>
$params
[
'area'
]
??
''
,
];
];
try
{
try
{
if
(
!
empty
(
$colonelData
[
'take_place_name'
]))
{
if
(
!
empty
(
$colonelData
[
'take_place_name'
]))
{
...
@@ -66,10 +66,10 @@ class ColonelService
...
@@ -66,10 +66,10 @@ class ColonelService
*/
*/
public
static
function
isApply
(
int
$userId
)
:
array
public
static
function
isApply
(
int
$userId
)
:
array
{
{
$applyInfo
=
ColonelDistributorColonelApply
::
getRecord
([
'user_id'
=>
$userId
],[
'colonel_apply_id'
,
'audit_status'
]);
$applyInfo
=
ColonelDistributorColonelApply
::
getRecord
([
'user_id'
=>
$userId
],
[
'colonel_apply_id'
,
'audit_status'
]);
return
[
return
[
'is_apply'
=>
!
empty
(
$applyInfo
)
?
1
:
0
,
// -1.未申请 0.未审核 1.审核通过 2.审核未通过
'a
udit_status'
=>
$applyInfo
[
'audit_status'
]
'a
pply_status'
=>
isset
(
$applyInfo
[
'audit_status'
])
?
intval
(
$applyInfo
[
'audit_status'
])
:
-
1
];
];
}
}
...
@@ -88,7 +88,7 @@ class ColonelService
...
@@ -88,7 +88,7 @@ class ColonelService
if
(
empty
(
$result
[
'count'
]))
{
if
(
empty
(
$result
[
'count'
]))
{
return
$result
;
return
$result
;
}
}
$userMap
=
self
::
getUserMap
(
array_column
(
$result
[
'result'
],
'user_id'
));
$userMap
=
self
::
getUserMap
(
array_column
(
$result
[
'result'
],
'user_id'
));
$takePlaceMap
=
self
::
getColonelTakePlaceMap
(
array_column
(
$result
[
'result'
],
'colonel_apply_id'
));
$takePlaceMap
=
self
::
getColonelTakePlaceMap
(
array_column
(
$result
[
'result'
],
'colonel_apply_id'
));
foreach
(
$result
[
'result'
]
as
&
$applyVal
)
{
foreach
(
$result
[
'result'
]
as
&
$applyVal
)
{
$applyVal
[
'user_avatar'
]
=
!
empty
(
$userMap
[
$applyVal
[
'user_id'
]][
'user_avatar'
])
?
$userMap
[
$applyVal
[
'user_id'
]][
'user_avatar'
]
:
''
;
$applyVal
[
'user_avatar'
]
=
!
empty
(
$userMap
[
$applyVal
[
'user_id'
]][
'user_avatar'
])
?
$userMap
[
$applyVal
[
'user_id'
]][
'user_avatar'
]
:
''
;
...
@@ -124,9 +124,9 @@ class ColonelService
...
@@ -124,9 +124,9 @@ class ColonelService
$incomeMap
=
PindanActivityInviteOrderService
::
incomeStatistics
([
"user_ids"
=>
$userIds
]);
$incomeMap
=
PindanActivityInviteOrderService
::
incomeStatistics
([
"user_ids"
=>
$userIds
]);
foreach
(
$result
[
'result'
]
as
&
$colonelVal
)
{
foreach
(
$result
[
'result'
]
as
&
$colonelVal
)
{
$userId
=
$colonelVal
[
'user_id'
];
$userId
=
$colonelVal
[
'user_id'
];
$colonelVal
[
'user_avatar'
]
=
!
empty
(
$userMap
[
$userId
][
'user_avatar'
])
?
$userMap
[
$userId
][
'user_avatar'
]
:
''
;
$colonelVal
[
'user_avatar'
]
=
!
empty
(
$userMap
[
$userId
][
'user_avatar'
])
?
$userMap
[
$userId
][
'user_avatar'
]
:
''
;
$colonelVal
[
'yesterday_income'
]
=
!
empty
(
$incomeMap
[
$userId
][
'yesterday_reward'
])
?
$incomeMap
[
$userId
][
'yesterday_reward'
]
:
0
;
$colonelVal
[
'yesterday_income'
]
=
!
empty
(
$incomeMap
[
$userId
][
'yesterday_reward'
])
?
$incomeMap
[
$userId
][
'yesterday_reward'
]
:
0
;
$colonelVal
[
'total_income'
]
=
!
empty
(
$incomeMap
[
$userId
][
'all_reward'
])
?
$incomeMap
[
$userId
][
'all_reward'
]
:
0
;
$colonelVal
[
'total_income'
]
=
!
empty
(
$incomeMap
[
$userId
][
'all_reward'
])
?
$incomeMap
[
$userId
][
'all_reward'
]
:
0
;
}
}
unset
(
$colonelVal
);
unset
(
$colonelVal
);
return
$result
;
return
$result
;
...
@@ -245,13 +245,13 @@ class ColonelService
...
@@ -245,13 +245,13 @@ class ColonelService
{
{
// 入库团长表
// 入库团长表
$colonelData
=
[
$colonelData
=
[
'user_id'
=>
$applyInfo
[
'user_id'
],
'user_id'
=>
$applyInfo
[
'user_id'
],
'colonel_apply_id'
=>
$applyInfo
[
'colonel_apply_id'
],
'colonel_apply_id'
=>
$applyInfo
[
'colonel_apply_id'
],
'take_place_id'
=>
0
,
'take_place_id'
=>
0
,
'life_account_id'
=>
$applyInfo
[
'life_account_id'
],
'life_account_id'
=>
$applyInfo
[
'life_account_id'
],
'phone'
=>
$applyInfo
[
'phone'
],
'phone'
=>
$applyInfo
[
'phone'
],
'contact_name'
=>
$applyInfo
[
'contact_name'
],
'contact_name'
=>
$applyInfo
[
'contact_name'
],
'colonel_source'
=>
ColonelDistributorColonel
::
COLONEL_SOURCE_APPLY
'colonel_source'
=>
ColonelDistributorColonel
::
COLONEL_SOURCE_APPLY
];
];
return
ColonelDistributorColonel
::
insertRecord
(
$colonelData
);
return
ColonelDistributorColonel
::
insertRecord
(
$colonelData
);
}
}
...
@@ -291,7 +291,7 @@ class ColonelService
...
@@ -291,7 +291,7 @@ class ColonelService
*/
*/
private
static
function
getPageParams
(
array
$params
=
[])
:
array
private
static
function
getPageParams
(
array
$params
=
[])
:
array
{
{
$params
[
'page'
]
=
!
empty
(
$params
[
'page'
])
?
$params
[
'page'
]
:
1
;
$params
[
'page'
]
=
!
empty
(
$params
[
'page'
])
?
$params
[
'page'
]
:
1
;
$params
[
'page_size'
]
=
!
empty
(
$params
[
'page_size'
])
?
$params
[
'page_size'
]
:
20
;
$params
[
'page_size'
]
=
!
empty
(
$params
[
'page_size'
])
?
$params
[
'page_size'
]
:
20
;
return
$params
;
return
$params
;
}
}
...
...
application/services/marketing/PindanActivityColonelConfigService.php
View file @
6f42d1d9
...
@@ -21,6 +21,7 @@ class PindanActivityColonelConfigService
...
@@ -21,6 +21,7 @@ class PindanActivityColonelConfigService
$date
=
$params
[
"date"
];
$date
=
$params
[
"date"
];
$type
=
empty
(
$params
[
"type"
])
?
ColonelDistributorConfig
::
TYPE_COLONEL
:
$params
[
"type"
];
$type
=
empty
(
$params
[
"type"
])
?
ColonelDistributorConfig
::
TYPE_COLONEL
:
$params
[
"type"
];
$configList
=
$params
[
"config"
];
$configList
=
$params
[
"config"
];
$marketingId
=
$params
[
"marketing_id"
];
if
(
empty
(
$configList
))
{
if
(
empty
(
$configList
))
{
throw
new
MarketingException
([
'cus'
=>
MarketingException
::
COLONEL_CONFIG_NULL
]);
throw
new
MarketingException
([
'cus'
=>
MarketingException
::
COLONEL_CONFIG_NULL
]);
...
@@ -29,28 +30,25 @@ class PindanActivityColonelConfigService
...
@@ -29,28 +30,25 @@ class PindanActivityColonelConfigService
if
(
count
(
$configList
)
>
6
)
{
if
(
count
(
$configList
)
>
6
)
{
throw
new
MarketingException
([
'cus'
=>
MarketingException
::
COLONEL_LEVEL_SIX
]);
throw
new
MarketingException
([
'cus'
=>
MarketingException
::
COLONEL_LEVEL_SIX
]);
}
}
ColonelDistributorConfig
::
beginTransaction
();
$idRes
=
ColonelDistributorConfig
::
getRecord
([
"date"
=>
$date
,
"type"
=>
$type
],
[
"colonel_config_id"
]);
$idRes
=
ColonelDistributorConfig
::
getRecord
([
"date"
=>
$date
,
"type"
=>
$type
,
"marketing_id"
=>
$marketingId
],
[
"colonel_config_id"
]);
if
(
!
empty
(
$idRes
))
{
if
(
!
empty
(
$idRes
))
{
ColonelDistributorConfig
::
save
([
ColonelDistributorConfig
::
save
([
"marketing_id"
=>
$marketingId
,
"date"
=>
$date
,
"date"
=>
$date
,
"type"
=>
$type
,
"type"
=>
$type
,
"data"
=>
$configList
,
"data"
=>
$configList
,
],
$idRes
[
"colonel_config_id"
]);
],
[
"colonel_config_id"
=>
$idRes
[
"colonel_config_id"
]
]);
}
else
{
}
else
{
ColonelDistributorConfig
::
save
([
ColonelDistributorConfig
::
save
([
"marketing_id"
=>
$marketingId
,
"date"
=>
$date
,
"date"
=>
$date
,
"type"
=>
$type
,
"type"
=>
$type
,
"data"
=>
$configList
,
"data"
=>
$configList
,
]);
]);
}
}
if
(
!
ColonelDistributorConfig
::
commit
())
{
ColonelDistributorConfig
::
rollback
();
throw
new
MarketingException
([
"cus"
=>
5
]);
}
return
true
;
return
true
;
}
}
...
...
application/services/user/UserService.php
View file @
6f42d1d9
...
@@ -192,6 +192,10 @@ class UserService
...
@@ -192,6 +192,10 @@ class UserService
if
(
!
empty
(
$params
[
'user_id'
]))
{
if
(
!
empty
(
$params
[
'user_id'
]))
{
$data
[
'user_id'
]
=
$params
[
'user_id'
];
$data
[
'user_id'
]
=
$params
[
'user_id'
];
}
}
if
(
!
empty
(
$params
[
'phone'
]))
{
$data
[
'phone'
]
=
$params
[
'phone'
];
}
$userList
=
UserWechatBind
::
getRecords
(
$data
);
$userList
=
UserWechatBind
::
getRecords
(
$data
);
return
$userList
;
return
$userList
;
...
...
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