feat: 初始化雄戈商城服务端代码与Webhook自动部署配置
这个提交包含在:
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace addons\shopro\controller;
|
||||
|
||||
use addons\shopro\exception\Exception;
|
||||
use addons\shopro\model\Store as ModelStore;
|
||||
use addons\shopro\model\User;
|
||||
use addons\shopro\model\UserStore;
|
||||
|
||||
class Store extends Base
|
||||
{
|
||||
|
||||
protected $noNeedLogin = [];
|
||||
protected $noNeedRight = ['*'];
|
||||
|
||||
public function index()
|
||||
{
|
||||
$this->error('门店管理功能已关闭');
|
||||
$user = User::info();
|
||||
$userStore = UserStore::where('user_id', $user->id)->select();
|
||||
$store_id_arr = array_column($userStore, 'store_id');
|
||||
|
||||
$stores = [];
|
||||
if ($store_id_arr) {
|
||||
$stores = ModelStore::show()->where('id', 'in', $store_id_arr)->select();
|
||||
}
|
||||
|
||||
$this->success('获取门店列表', $stores);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取门店列表
|
||||
* @throws \think\exception\DbException
|
||||
*/
|
||||
public function getStoreList()
|
||||
{
|
||||
$page = input('param.page/d', 1);
|
||||
$result = ModelStore::where(['status' => 1])
|
||||
->field('content,status,createtime,updatetime,deletetime', true)
|
||||
->paginate(10, false, [
|
||||
'page' => $page
|
||||
]);
|
||||
|
||||
$data = [
|
||||
'list' => $result->items(),
|
||||
'total' => $result->total(),
|
||||
'page' => $result->currentPage(),
|
||||
'pageSize' => $result->listRows(),
|
||||
'totalSize' => $result->lastPage()
|
||||
];
|
||||
|
||||
$this->success('获取门店列表成功', $data);
|
||||
}
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户