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
9750a7c5
Commit
9750a7c5
authored
Jun 30, 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
a47c2b93
a5ed12ee
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
105 additions
and
6 deletions
+105
-6
Distributor.php
application/modules/Marketing/controllers/Distributor.php
+12
-1
Marketinggoods.php
application/modules/Marketing/controllers/Marketinggoods.php
+36
-1
DistributorService.php
application/services/marketing/DistributorService.php
+57
-4
No files found.
application/modules/Marketing/controllers/Distributor.php
View file @
9750a7c5
...
...
@@ -85,6 +85,17 @@ class DistributorController extends Base
$this
->
success
([
'result'
=>
$info
]);
}
/**
* 获取分享二维码
*
*/
public
function
distributor_code_urlAction
()
{
$params
=
$this
->
params
;
$info
=
DistributorService
::
distributorCodeUrl
(
$params
);
$this
->
success
([
'result'
=>
$info
]);
}
/**
* 获取待审核的团长列表
* 后台管理
...
...
application/modules/Marketing/controllers/Marketinggoods.php
View file @
9750a7c5
...
...
@@ -3,7 +3,10 @@
use
App\Base\Base
;
use
App\Services\marketing\MarketingGoodsService
;
use
App\Exception\custom\DistributorException
;
use
App\Models\goods\mysql\GoodsSku
;
use
Helpers\Aes
;
use
Api\PhpServices\JwUser\JwUser
;
use
Api\PhpServices\Ksy\Ksyun
;
class
MarketinggoodsController
extends
Base
{
...
...
@@ -41,8 +44,40 @@ class MarketinggoodsController extends Base
}
$goodsShareId
=
Aes
::
encrypt
(
$content
);
$jwUser
=
(
new
JwUser
())
->
getUserByUserId
([
'user_id'
=>
$userId
]);
$avatar
=
''
;
$nickName
=
''
;
if
(
!
empty
(
$jwUser
[
'data'
])
&&
$jwUser
[
'code'
]
==
0
)
{
$avatar
=
!
empty
(
$jwUser
[
'data'
][
'avatar'
])
?
$jwUser
[
'data'
][
'avatar'
]
:
''
;
$nickName
=
!
empty
(
$jwUser
[
'data'
][
'nickName'
])
?
$jwUser
[
'data'
][
'nickName'
]
:
''
;
}
$goodsSkuInfo
=
GoodsSku
::
getRecord
([
'goods_sku_id'
=>
$goodsSkuId
]);
$goodsName
=
!
empty
(
$goodsSkuInfo
[
'goods_name'
])
?
$goodsSkuInfo
[
'goods_name'
]
:
''
;
$oldPrice
=
!
empty
(
$goodsSkuInfo
[
'original_price'
])
?
$goodsSkuInfo
[
'original_price'
]
:
''
;
$price
=
!
empty
(
$goodsSkuInfo
[
'price'
])
?
$goodsSkuInfo
[
'price'
]
:
''
;
if
(
!
empty
(
$goodsSkuInfo
[
"desc_pic_url"
]))
{
$image
=
explode
(
","
,
$goodsSkuInfo
[
"desc_pic_url"
]);
$ksyun
=
Ksyun
::
getDownUrl
(
$image
,
'merchant-b'
,
'bp-yidian'
,
60
);
$descPicUrlList
=
array_values
(
$ksyun
);
}
$goodsImg
=
!
empty
(
$descPicUrlList
[
0
])
?
$descPicUrlList
[
0
]
:
''
;
//商品图片url地址
//$qr_string = "";//二维码扫描后的内容
$data
[
'goods_share_id'
]
=
$goodsShareId
;
$data
[
'share_img_url'
]
=
''
;
$data
[
'share_data'
]
=
[
'goods_img'
=>
$goodsImg
,
'price'
=>
$price
,
'original_price'
=>
$oldPrice
,
'goods_name'
=>
$goodsName
,
'nick_name'
=>
$nickName
,
'avatar'
=>
$avatar
,
];
$result
=
[
'result'
=>
$data
];
$this
->
success
(
$result
);
}
...
...
application/services/marketing/DistributorService.php
View file @
9750a7c5
...
...
@@ -12,6 +12,8 @@ use Api\PhpServices\Sensitive\Sensitive;
use
Api\PhpServices\JwUser\JwUser
;
use
Api\PhpUtils\Common\TimeOut
;
use
App\Exception\custom\CodeSpecialException
;
use
Api\PhpServices\ShopImage\GetImage
;
use
Api\PhpServices\ShopImage\QR
;
class
DistributorService
{
...
...
@@ -33,6 +35,14 @@ class DistributorService
$where
[
'parent_user_id'
]
=
$params
[
'user_id'
];
}
$totalNum
=
Distributor
::
getCount
(
$where
,
"*"
);
$countWhere
=
[
'parent_user_id'
=>
!
empty
(
$params
[
'user_id'
])
?
$params
[
'user_id'
]
:
''
,
"create_time[><]"
=>
[
date
(
"Y-m-d 00:00:00"
),
date
(
"Y-m-d 23:59:59"
)]
];
$todayNum
=
Distributor
::
getCount
(
$countWhere
,
"*"
);
if
(
!
empty
(
$params
[
'last_id'
]))
{
$where
[
'id[<]'
]
=
$params
[
'last_id'
];
}
...
...
@@ -42,7 +52,8 @@ class DistributorService
$list
=
Distributor
::
getRecords
(
$where
);
$last
=
end
(
$list
);
$lastId
=
!
empty
(
$last
[
'id'
])
?
$last
[
'id'
]
:
''
;
$data
=
[
'result'
=>
$list
,
'last_id'
=>
$lastId
];
$data
=
[
'result'
=>
$list
,
'last_id'
=>
$lastId
,
'distributor_today_num'
=>
$todayNum
,
'distributor_total_num'
=>
$totalNum
];
return
$data
;
}
...
...
@@ -281,7 +292,10 @@ class DistributorService
}
}
/**
* 获取二维码
*
*/
public
static
function
distributor
(
$params
)
{
...
...
@@ -303,6 +317,45 @@ class DistributorService
}
public
static
function
distributorCodeUrl
(
$params
)
{
if
(
empty
(
$params
[
'user_id'
]))
{
throw
new
DistributorException
([
'cus'
=>
14
]);
}
$where
[
'user_id'
]
=
$params
[
'user_id'
];
$data
=
[];
$info
=
Distributor
::
getRecord
(
$where
);
//$distributorCodeUrl = (new GetImage())->getLeaderShare($info['distributor_code']);
// $qr = new QR("http://www.baidu.com");
// $qr->setWriteFile(1);
// $aa = $qr->get();
// print_r($aa);
//echo $info['distributor_code'] = "http://www.baidu.com";
$distributorCodeUrl
=
(
new
GetImage
())
->
getLeaderShare
(
"123456"
);
//$distributorCodeUrl = (new GetImage())->getCoupon("店铺测试", "商品苹果", "99.23", "北京", "哼哼");
//$distributorCodeUrl = (new GetImage())->getCoupon("店铺测试", "商品苹果", "99.23", "北京", "哼哼");
//$distributorCodeUrl = (new GetImage())->getGoods('', '', "以后", "商品苹果", "111", "12", $old_price = 0, $buy_count=0);
//$qr = new QR("http://www.baidu.com");
//$qr->setWriteFile(1);
// $pngData = $qr->get();
//return $distributorCodeUrl ;
}
/**
...
...
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