Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wxh_internal_api
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
杨培培
wxh_internal_api
Commits
f8dcbf0d
Commit
f8dcbf0d
authored
May 27, 2019
by
杨培
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增店铺接口
parent
2bfa4ef7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
0 deletions
+91
-0
shop_shop.php
example/shop_shop.php
+22
-0
Shop.php
src/shop/Shop.php
+69
-0
No files found.
example/shop_shop.php
0 → 100644
View file @
f8dcbf0d
<?php
/**
* Created by PhpStorm.
* User: pader
* Date: 2019/5/27
* Time: 17:40
*/
use
internalApi\shop\Shop
;
require
__DIR__
.
'/_init.php'
;
Shop
::
setDebug
();
$arr
=
Shop
::
getShop
(
1
);
//$arr = Shop::fetchList(null, 1, 50);
//Shop::saveShop([
// 'id' => 15,
// 'status' => 0
//]);
src/shop/Shop.php
0 → 100644
View file @
f8dcbf0d
<?php
/**
* Created by PhpStorm.
* User: pader
* Date: 2019/5/27
* Time: 17:38
*/
namespace
internalApi\shop
;
use
internalApi\base\Client
;
class
Shop
extends
Client
{
/**
* 查询店铺列表
*
* @param array|null $filter 查询条件,目前仅支持 status
* 示例:['status'=>1]
* @param int $page
* @param int $num
* @return array|null
* @throws \internalApi\base\ApiException
* @throws \internalApi\base\ClientException
*/
public
static
function
fetchList
(
$filter
,
$page
=
1
,
$num
=
50
)
{
return
self
::
call
(
'shop.fetchList'
,
compact
(
'filter'
,
'page'
,
'num'
));
}
/**
* 添加/修改店铺
*
* @param array $data 店铺数据
* 当店铺数据中包含 id 字段时则为修改该 id 字段店铺,否则为新建
* 支持修改的字段列表
* description: 店铺简介
* code: 店铺编码
* name: 店铺名称
* 店铺地址: address
* 店铺等级ID: level_id
* 让长SSO UID: manager_id
* 服务星账号(手机号): star_tel
* 仓库ID: warehouse_id
* 状态: status,0 为停用状态,1为正常状态
* @return bool
* @throws \internalApi\base\ApiException
* @throws \internalApi\base\ClientException
*/
public
static
function
saveShop
(
$data
)
{
return
self
::
call
(
'shop.saveShop'
,
compact
(
'data'
));
}
/**
* 获取指定店铺的详情
*
* @param int $id
* @return array
* @throws \internalApi\base\ApiException
* @throws \internalApi\base\ClientException
*/
public
static
function
getShop
(
$id
)
{
return
self
::
call
(
'shop.getShop'
,
compact
(
'id'
));
}
}
\ No newline at end of file
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