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
3c42df69
Commit
3c42df69
authored
Jul 09, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://git.yidian-inc.com:8021/bp/goods
into develop
parents
95f7b8b6
c6a6b6e6
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
110 additions
and
5 deletions
+110
-5
MarketingException.php
application/exception/custom/MarketingException.php
+1
-1
QyqGroupleader.php
application/models/marketing/mysql/QyqGroupleader.php
+66
-0
Distributor.php
application/modules/Marketing/controllers/Distributor.php
+6
-0
GoodsService.php
application/services/goods/GoodsService.php
+3
-0
DistributorService.php
application/services/marketing/DistributorService.php
+31
-1
MarketingService.php
application/services/marketing/MarketingService.php
+3
-3
No files found.
application/exception/custom/MarketingException.php
View file @
3c42df69
...
...
@@ -12,7 +12,7 @@ class MarketingException extends BaseException
protected
$cus
=
[
0
=>
'活动名称不能为空'
,
1
=>
'活动名称不能大于
4
0'
,
1
=>
'活动名称不能大于
5
0'
,
2
=>
'活动名称不合法'
,
3
=>
'(一级)佣金率不能为空'
,
4
=>
'(二级)佣金率不能为空'
,
...
...
application/models/marketing/mysql/QyqGroupleader.php
0 → 100644
View file @
3c42df69
<?php
namespace
App\Models\marketing\mysql
;
use
Api\PhpUtils\Mysql\MysqlBase
;
class
QyqGroupleader
extends
MysqlBase
{
const
TABLE_NAME
=
'qyq_groupleader'
;
const
CONFIG_INDEX
=
'goods'
;
const
PRIMARY_KEY
=
'id'
;
public
static
function
getRecord
(
$where
,
$colums
=
[])
{
if
(
empty
(
$colums
))
{
$colums
=
'*'
;
}
return
self
::
get
(
$colums
,
$where
);
}
public
static
function
getRecordMaster
(
$where
,
$colums
=
[])
{
if
(
empty
(
$colums
))
{
$colums
=
'*'
;
}
return
self
::
selectMaster
(
$colums
,
$where
);
}
public
static
function
insertRecord
(
$colums
)
{
return
self
::
insert
(
$colums
);
}
public
static
function
updateRecord
(
$colums
,
$where
)
{
return
self
::
update
(
$colums
,
$where
);
}
public
static
function
save
(
$data
,
$where
=
[])
{
if
(
empty
(
$where
))
{
return
self
::
insert
(
$data
);
}
return
self
::
update
(
$data
,
$where
);
}
public
static
function
deleteRecord
(
$where
)
{
return
self
::
delete
(
$where
);
}
public
static
function
getRecords
(
$where
,
$colums
=
[])
{
if
(
empty
(
$colums
))
{
$colums
=
'*'
;
}
return
self
::
select
(
$colums
,
$where
);
}
public
static
function
getCount
(
$where
,
$columns
=
"*"
)
{
if
(
empty
(
$columns
))
{
$columns
=
'*'
;
}
return
self
::
count
(
$columns
,
$where
);
}
}
application/modules/Marketing/controllers/Distributor.php
View file @
3c42df69
...
...
@@ -9,6 +9,12 @@ use \Validate\CheckIsDistributorValidate;
class
DistributorController
extends
Base
{
public
function
importAction
()
{
$distributionList
=
DistributorService
::
import
();
print_r
(
$distributionList
);
}
/**
* 二级团长列表
*
...
...
application/services/goods/GoodsService.php
View file @
3c42df69
...
...
@@ -1195,6 +1195,9 @@ class GoodsService
$where
[
'goods_sku_id'
]
=
$params
[
'goods_sku_id'
];
}
$info
=
GoodsSku
::
getRecord
(
$where
);
$info
[
'original_price'
]
=
$info
[
'original_price'
]
/
100
;
$info
[
'price'
]
=
$info
[
'price'
]
/
100
;
$info
[
'desc_pic_url'
]
=
self
::
getUrlList
(
$info
[
'desc_pic_url'
]);
$info
[
'introduce_pic_url'
]
=
self
::
getUrlList
(
$info
[
'introduce_pic_url'
]);
return
$info
;
...
...
application/services/marketing/DistributorService.php
View file @
3c42df69
...
...
@@ -4,6 +4,7 @@
namespace
App\Services\marketing
;
use
App\Models\marketing\mysql\Distributor
;
use
App\Models\marketing\mysql\QyqGroupleader
;
use
App\Models\marketing\mysql\DistributorAuditRecord
;
use
Api\PhpUtils\Validate\Validate
;
use
Api\PhpServices\Idgen\Idgen
;
...
...
@@ -17,7 +18,36 @@ use Api\PhpServices\ShopImage\QR;
use
App\Exception\custom\InterfaceException
;
class
DistributorService
{
{
public
static
function
import
()
{
$list
=
QyqGroupleader
::
getRecords
([
'status[>=]'
=>
0
]);
foreach
(
$list
as
$key
=>
$value
)
{
$userId
=
$value
[
'userId'
];
if
(
empty
(
$value
[
'parentUserId'
]))
{
$distributorType
=
1
;
}
else
{
$distributorType
=
2
;
}
$distributorData
=
[
'parent_user_id'
=>
$value
[
'parentUserId'
],
'user_id'
=>
$userId
,
'distributor_code'
=>
''
,
'distributor_type'
=>
$distributorType
,
//1申请团长,2申请二级团长
'user_name'
=>
$value
[
'userName'
],
'create_time'
=>
$value
[
'createTime'
],
'update_time'
=>
$value
[
'updateTime'
],
];
Distributor
::
insertRecord
(
$distributorData
);
}
echo
"成功"
;
}
/**
* 查询二级团长
*
...
...
application/services/marketing/MarketingService.php
View file @
3c42df69
...
...
@@ -165,9 +165,9 @@ class MarketingService
throw
new
MarketingException
([
'cus'
=>
3
]);
}
if
(
empty
(
$secondCommissionRate
))
{
throw
new
MarketingException
([
'cus'
=>
4
]);
}
//
if (empty($secondCommissionRate)) {
//
throw new MarketingException(['cus'=>4]);
//
}
if
(
self
::
utf8Strlen
(
$marketingName
)
>
50
)
{
throw
new
MarketingException
([
'cus'
=>
1
]);
...
...
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