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
220bc787
Commit
220bc787
authored
Oct 11, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 商品详情支持二手商品
parent
96ba8a65
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
3 deletions
+35
-3
ErshouGoodsService.php
application/services/goods/ErshouGoodsService.php
+32
-0
GoodsService.php
application/services/goods/GoodsService.php
+3
-3
No files found.
application/services/goods/ErshouGoodsService.php
View file @
220bc787
...
@@ -26,6 +26,7 @@ use App\Models\goods\mysql\LifeAccountShopNum;
...
@@ -26,6 +26,7 @@ use App\Models\goods\mysql\LifeAccountShopNum;
use
App\Models\goods\mysql\Ota
;
use
App\Models\goods\mysql\Ota
;
use
App\Models\goods\mysql\PaySuccessGoodsCallbackRecord
;
use
App\Models\goods\mysql\PaySuccessGoodsCallbackRecord
;
use
App\Models\goods\mysql\ErshouGoodsSku
;
use
App\Models\goods\mysql\ErshouGoodsSku
;
use
App\Models\goods\mysql\PindanGoodsSku
;
use
App\Models\goods\mysql\PindanGoodsSnapshot
;
use
App\Models\goods\mysql\PindanGoodsSnapshot
;
use
App\Models\goods\mysql\Shop
;
use
App\Models\goods\mysql\Shop
;
use
App\Models\marketing\mysql\Distributor
;
use
App\Models\marketing\mysql\Distributor
;
...
@@ -218,4 +219,35 @@ class ErshouGoodsService
...
@@ -218,4 +219,35 @@ class ErshouGoodsService
GoodsService
::
addGoodsSkuPicRecord
(
$skuId
,
$skuData
);
GoodsService
::
addGoodsSkuPicRecord
(
$skuId
,
$skuData
);
return
$skuId
;
return
$skuId
;
}
}
/**
* 二手商品商品详情
* @param $params
* @return array
* @throws GoodsException
*/
public
static
function
ershouGoodsInfo
(
$params
)
{
$data
=
[];
$sku
=
ErshouGoodsSku
::
get
(
"*"
,
[
"goods_sku_id"
=>
$params
[
"goods_sku_id"
]]);
if
(
empty
(
$sku
))
{
throw
new
GoodsException
([
"cus"
=>
15
]);
}
$data
[
"goods_info"
]
=
$sku
;
$data
[
"goods_info"
][
"original_price"
]
=
empty
(
$sku
[
"original_price"
])
?
''
:
(
string
)(
$sku
[
"original_price"
]
/
100
);
$data
[
"goods_info"
][
"price"
]
=
$sku
[
"price"
]
/
100
;
$data
[
"goods_info"
][
"desc_pic_url_list"
]
=
[];
if
(
!
empty
(
$sku
[
"desc_pic_url"
]))
{
$ksyun
=
GoodsService
::
getUrlList
(
$sku
[
"desc_pic_url"
]);
$data
[
"goods_info"
][
"desc_pic_url_list"
]
=
$ksyun
;
$strList
=
explode
(
","
,
$sku
[
"desc_pic_url"
]);
$shareStr
=
$strList
[
0
];
$shareRes
=
Ks3Api
::
picEncryptUrl
(
$shareStr
,
500
,
400
);
$shareUrl
=
empty
(
$shareRes
[
"response"
][
"data"
][
"url"
])
?
""
:
$shareRes
[
"response"
][
"data"
][
"url"
];
$data
[
"goods_info"
][
"share_url"
]
=
$shareUrl
;
}
return
$data
;
}
}
}
\ No newline at end of file
application/services/goods/GoodsService.php
View file @
220bc787
...
@@ -1126,16 +1126,16 @@ class GoodsService
...
@@ -1126,16 +1126,16 @@ class GoodsService
{
{
$goodsSukParams
=
GoodsSkuId
::
getGoodsSkuIdParams
(
$params
[
"goods_sku_id"
]);
$goodsSukParams
=
GoodsSkuId
::
getGoodsSkuIdParams
(
$params
[
"goods_sku_id"
]);
if
(
!
empty
(
$goodsSukParams
))
{
if
(
!
empty
(
$goodsSukParams
))
{
if
(
isset
(
$goodsSukParams
[
"table_tag"
])
&&
(
$goodsSukParams
[
"table_tag"
]
==
GoodsSkuId
::
TABLE_TAG_PINDAN
if
(
isset
(
$goodsSukParams
[
"table_tag"
])
&&
(
$goodsSukParams
[
"table_tag"
]
==
GoodsSkuId
::
TABLE_TAG_PINDAN
))
{
||
$goodsSukParams
[
"category_1_id"
]
==
"00"
))
{
return
MarketingPindanGoodsService
::
pindanGoodsInfo
(
$params
);
return
MarketingPindanGoodsService
::
pindanGoodsInfo
(
$params
);
}
elseif
(
isset
(
$goodsSukParams
[
"table_tag"
])
&&
(
$goodsSukParams
[
"table_tag"
]
==
GoodsSkuId
::
TABLE_TAG_ERSHOU
))
{
return
ErshouGoodsService
::
ershouGoodsInfo
(
$params
);
}
else
{
}
else
{
return
self
::
generalGoodsInfo
(
$params
);
return
self
::
generalGoodsInfo
(
$params
);
}
}
}
else
{
}
else
{
throw
new
GoodsException
([
"cus"
=>
41
]);
throw
new
GoodsException
([
"cus"
=>
41
]);
}
}
}
}
/**
/**
...
...
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