mirror of
https://github.com/crmeb/CRMEB.git
synced 2026-03-26 07:13:10 +00:00
70 lines
2.2 KiB
PHP
70 lines
2.2 KiB
PHP
<?php
|
||
// +----------------------------------------------------------------------
|
||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||
// +----------------------------------------------------------------------
|
||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||
// +----------------------------------------------------------------------
|
||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||
// +----------------------------------------------------------------------
|
||
// | Author: CRMEB Team <admin@crmeb.com>
|
||
// +----------------------------------------------------------------------
|
||
namespace app\api\controller\v1\activity;
|
||
|
||
use app\Request;
|
||
use app\services\activity\integral\StoreIntegralServices;
|
||
|
||
class StoreIntegralController
|
||
{
|
||
protected $services;
|
||
|
||
public function __construct(StoreIntegralServices $services)
|
||
{
|
||
$this->services = $services;
|
||
}
|
||
|
||
/**
|
||
* 积分商城首页数据
|
||
* @return mixed
|
||
* @throws \think\db\exception\DataNotFoundException
|
||
* @throws \think\db\exception\DbException
|
||
* @throws \think\db\exception\ModelNotFoundException
|
||
*/
|
||
public function index()
|
||
{
|
||
$data['banner'] = sys_data('integral_shop_banner') ?? [];//TODO 积分商城banner
|
||
$where = ['is_show' => 1];
|
||
$where['is_host'] = 1;
|
||
$data['list'] = $this->services->getIntegralList($where);
|
||
return app('json')->success(get_thumb_water($data, 'big'));
|
||
}
|
||
|
||
/**
|
||
* 商品列表
|
||
* @param Request $request
|
||
* @return mixed
|
||
*/
|
||
public function lst(Request $request)
|
||
{
|
||
$where = $request->getMore([
|
||
['store_name', ''],
|
||
['priceOrder', ''],
|
||
['salesOrder', ''],
|
||
]);
|
||
$where['is_show'] = 1;
|
||
$list = $this->services->getIntegralList($where);
|
||
return app('json')->success(get_thumb_water($list, 'mid'));
|
||
}
|
||
|
||
/**
|
||
* 积分商品详情
|
||
* @param Request $request
|
||
* @param $id
|
||
* @return mixed
|
||
*/
|
||
public function detail(Request $request, $id)
|
||
{
|
||
$data = $this->services->integralDetail($request, $id);
|
||
return app('json')->success($data);
|
||
}
|
||
}
|