|
|
@@ -23,21 +23,6 @@ use App\Services\Common\AccountService;
|
|
|
class AccountController extends Backend
|
|
|
{
|
|
|
/**
|
|
|
- * 获取商家对应的 user_id(用于数据隔离)
|
|
|
- * @return int|null
|
|
|
- */
|
|
|
- private function getUserId()
|
|
|
- {
|
|
|
- if ($this->storeId > 0) {
|
|
|
- // 如果是商家登录,获取商家对应的 user_id
|
|
|
- $storeModel = new \App\Models\StoreModel();
|
|
|
- $storeInfo = $storeModel->find($this->storeId);
|
|
|
- return $storeInfo ? $storeInfo->user_id : null;
|
|
|
- }
|
|
|
- return null;
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
* 列表
|
|
|
*/
|
|
|
public function index()
|
|
|
@@ -46,9 +31,10 @@ class AccountController extends Backend
|
|
|
$params = request()->all();
|
|
|
|
|
|
// 获取商家对应的 user_id 用于数据隔离
|
|
|
- $userId = $this->getUserId();
|
|
|
- if ($userId) {
|
|
|
- $params['user_id'] = $userId;
|
|
|
+ if ($this->storeId) {
|
|
|
+ $params['store_id'] = $this->storeId;
|
|
|
+ }else if($this->memberId){
|
|
|
+ $params['user_id'] = $this->memberId;
|
|
|
}
|
|
|
|
|
|
$result = $service->getDataList($params, $params['limit']);
|
|
|
@@ -77,43 +63,4 @@ class AccountController extends Backend
|
|
|
|
|
|
return showJson($result['msg'], $result['code'] == 0, $result['data'] ?? []);
|
|
|
}
|
|
|
-
|
|
|
- // 财务明细只能查看,不能修改、添加、删除
|
|
|
- // 以下方法已禁用
|
|
|
-
|
|
|
- // /**
|
|
|
- // * 添加
|
|
|
- // */
|
|
|
- // public function add()
|
|
|
- // {
|
|
|
- // $result = $this->service->add();
|
|
|
- // return showJson($result['msg'], $result['code'] == 0);
|
|
|
- // }
|
|
|
-
|
|
|
- // /**
|
|
|
- // * 编辑
|
|
|
- // */
|
|
|
- // public function edit()
|
|
|
- // {
|
|
|
- // $result = $this->service->edit();
|
|
|
- // return showJson($result['msg'], $result['code'] == 0);
|
|
|
- // }
|
|
|
-
|
|
|
- // /**
|
|
|
- // * 设置状态
|
|
|
- // */
|
|
|
- // public function status()
|
|
|
- // {
|
|
|
- // $result = $this->service->status();
|
|
|
- // return showJson($result['msg'], $result['code'] == 0);
|
|
|
- // }
|
|
|
-
|
|
|
- // /**
|
|
|
- // * 删除
|
|
|
- // */
|
|
|
- // public function delete()
|
|
|
- // {
|
|
|
- // $result = $this->service->delete();
|
|
|
- // return showJson($result['msg'], $result['code'] == 0);
|
|
|
- // }
|
|
|
}
|