Commit f8dcbf0d authored by 杨培's avatar 杨培

新增店铺接口

parent 2bfa4ef7
<?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
//]);
<?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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment