优化代码

main
fengxinyhyl 6 months ago
parent 43cdb752e6
commit 6c9d61fac7
  1. 2
      app/common/repositories/system/merchant/MerchantTypeRepository.php
  2. 15
      app/controller/admin/system/merchant/Merchant.php
  3. 2
      app/controller/api/store/product/StoreSpu.php
  4. 2
      public/system.html
  5. 4
      view/admin/src/views/accounts/capitalFlow/index.vue

@ -20,6 +20,7 @@ use app\common\repositories\system\RelevanceRepository;
use FormBuilder\Factory\Elm;
use think\exception\ValidateException;
use think\facade\Db;
use think\facade\Log;
use think\facade\Route;
/**
@ -134,6 +135,7 @@ class MerchantTypeRepository extends BaseRepository
array_push($ids, $id);
}
$auth = app()->make(MenuRepository::class)->getAllOptions(1, true, compact('ids'));
Log::info("detail_auth".json_encode($auth));
$options = formatTree($auth, 'menu_name');
}

@ -15,6 +15,7 @@ namespace app\controller\admin\system\merchant;
use app\common\repositories\store\product\ProductCopyRepository;
use app\common\repositories\system\auth\MenuRepository;
use app\common\repositories\system\merchant\FinancialRecordRepository;
use app\common\repositories\system\merchant\MerchantTypeRepository;
use app\common\repositories\user\UserAssetsRepository;
@ -250,12 +251,24 @@ class Merchant extends BaseController
$adminInfo = $adminRepository->merIdByAdmin($id);
$tokenInfo = $adminRepository->createToken($adminInfo);
$admin = $adminInfo->toArray();
$merchant = $this->repository->get($id);
$typeMenu = (app(MerchantTypeRepository::class))->detail($merchant['type_id']);
Log::info("merchant_type".json_encode($typeMenu));
try {
$menuId = $typeMenu['options'][0]['children'][0]['id'];
$menu = \app(MenuRepository::class)->get($menuId);
$url = $menu['route'];
}catch (\Throwable $e){
$url = "/product/list";
}
Log::info("merchant_type_info".$typeMenu['options'][0]['children'][0]['id']);
unset($admin['pwd']);
$data = [
'token' => $tokenInfo['token'],
'exp' => $tokenInfo['out'],
'admin' => $admin,
'url' => '/' . config('admin.merchant_prefix').'/product/list'
'url' => '/' . config('admin.merchant_prefix').$url
];
return app('json')->success($data);

@ -68,7 +68,7 @@ class StoreSpu extends BaseController
$where['is_good'] = 1;
}
$where['order'] = $where['order'] ?: 'rank';
if ($where['is_trader'] != 1) unset($where['is_trader']);
// if ($where['is_trader'] != 1) unset($where['is_trader']);
$data = $this->repository->getApiSearch($where, $page, $limit, $this->userInfo);
return app('json')->success($data);
}

File diff suppressed because one or more lines are too long

@ -41,7 +41,7 @@
<el-button slot="append" icon="el-icon-search" size="small" class="el-button-solt" @click="getList(1)" />
</el-input>
<el-button size="small" type="primary" icon="el-icon-top" @click="exports">列表导出</el-button>
<!-- <el-button size="small" type="primary" @click="getExportFileList">导出记录</el-button> -->
<!-- <el-button size="small" type="primary" @click="getExportFileList">导出记录</el-button>-->
</el-form-item>
</el-form>
</div>
@ -193,7 +193,7 @@ export default {
/**资金流水 */
downData(excelData) {
return new Promise((resolve, reject) => {
fundingRecordsExportApi(excelData).then((res) => {
capitalFlowExportApi(excelData).then((res) => {
return resolve(res.data)
})
})

Loading…
Cancel
Save