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
0992741d
Commit
0992741d
authored
Jun 18, 2021
by
luhongguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:商品c端接口调试
parent
16a2eb05
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
13 deletions
+21
-13
ElasticGoodService.php
application/services/goods/ElasticGoodService.php
+9
-9
GoodsService.php
application/services/goods/GoodsService.php
+12
-4
No files found.
application/services/goods/ElasticGoodService.php
View file @
0992741d
...
...
@@ -105,15 +105,15 @@ class ElasticGoodService
if
(
!
empty
(
$res
[
"hits"
][
"total"
][
"value"
]))
{
$result
[
"count"
]
=
$res
[
"hits"
][
"total"
][
"value"
];
foreach
(
$res
[
"hits"
][
"hits"
]
as
$key
=>
$source
)
{
$result
[
"
data
"
][
$key
][
"id"
]
=
$source
[
"_source"
][
"id"
];
$result
[
"
data
"
][
$key
][
"goods_pic"
]
=
$source
[
"_source"
][
"goods_pic"
];
$result
[
"
data
"
][
$key
][
"name"
]
=
$source
[
"_source"
][
"name"
];
$result
[
"
data
"
][
$key
][
"inventory_rest"
]
=
$source
[
"_source"
][
"inventory_rest"
];
$result
[
"
data
"
][
$key
][
"total_amount_sold"
]
=
$source
[
"_source"
][
"total_amount_sold"
];
$result
[
"
data
"
][
$key
][
"original_price"
]
=
$source
[
"_source"
][
"original_price"
];
$result
[
"
data
"
][
$key
][
"price"
]
=
$source
[
"_source"
][
"price"
];
$result
[
"
data
"
][
$key
][
"status"
]
=
$source
[
"_source"
][
"status"
];
$result
[
"
data
"
][
$key
][
"online_status"
]
=
$source
[
"_source"
][
"online_status"
];
$result
[
"
list
"
][
$key
][
"id"
]
=
$source
[
"_source"
][
"id"
];
$result
[
"
list
"
][
$key
][
"goods_pic"
]
=
$source
[
"_source"
][
"goods_pic"
];
$result
[
"
list
"
][
$key
][
"name"
]
=
$source
[
"_source"
][
"name"
];
$result
[
"
list
"
][
$key
][
"inventory_rest"
]
=
$source
[
"_source"
][
"inventory_rest"
];
$result
[
"
list
"
][
$key
][
"total_amount_sold"
]
=
$source
[
"_source"
][
"total_amount_sold"
];
$result
[
"
list
"
][
$key
][
"original_price"
]
=
$source
[
"_source"
][
"original_price"
];
$result
[
"
list
"
][
$key
][
"price"
]
=
$source
[
"_source"
][
"price"
];
$result
[
"
list
"
][
$key
][
"status"
]
=
$source
[
"_source"
][
"status"
];
$result
[
"
list
"
][
$key
][
"online_status"
]
=
$source
[
"_source"
][
"online_status"
];
}
}
//为避免空数据时候返回给前端错误结构
...
...
application/services/goods/GoodsService.php
View file @
0992741d
...
...
@@ -540,9 +540,10 @@ class GoodsService
/**
* 商家 c端商品列表
* @param $lifeAccountId
* @param $type
* @return array
*/
public
static
function
getCGoodsSkuList
(
$lifeAccountId
)
public
static
function
getCGoodsSkuList
(
$lifeAccountId
,
$type
=
""
)
{
$statusList
=
[
[
"type"
=>
"online"
,
"name"
=>
"上架中"
],
...
...
@@ -550,9 +551,16 @@ class GoodsService
[
"type"
=>
"rejected"
,
"name"
=>
"被驳回"
],
[
"type"
=>
"offline"
,
"name"
=>
"已下架"
],
];
$where
=
[];
if
(
$type
==
"online"
)
{
$where
[
"status"
]
=
GoodsSku
::
STATUS_PASS
;
$where
[
"online_status"
]
=
GoodsSku
::
ONLINE_STATUS_ONLINE
;
}
$where
[
"life_account_id"
]
=
$lifeAccountId
;
$list
=
GoodsSku
::
select
([
"goods_sku_id"
,
"name"
,
"url"
,
"total_amount_sold"
,
"inventory_rest"
,
"original_price"
,
"price"
,
"status"
,
"online_status"
],
[
"life_account_id"
=>
$lifeAccountId
]);
"price"
,
"status"
,
"online_status"
],
$where
);
$data
=
[
"online"
=>
[],
...
...
@@ -577,7 +585,7 @@ class GoodsService
}
}
return
[
"status_list"
=>
$statusList
,
"
data
"
=>
$data
];
return
[
"status_list"
=>
$statusList
,
"
list
"
=>
$data
];
}
/**
...
...
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