drag-create-api/app/common/logic/Customer/Customer.php

63 lines
1.5 KiB
PHP

<?php
declare(strict_types=1);
namespace app\common\logic\Customer;
use app\common\model\Token;
use app\common\model\Customer\Customer as ModelCustomer;
use app\common\model\Menu\Menu as ModelMenu;
use app\common\model\Menu\MenuApi as ModelMenuApi;
use think\facade\Config;
use think\facade\Request;
use think\helper\Arr;
use think\Response;
use think\response\Redirect;
use app\common\arw\adjfut\src\Curl;
use app\common\arw\adjfut\src\Tool;
class Customer
{
/**
* 获取客户菜单
*
* @return array
* @date 2023-06-25
* @author xjh
* @since 1.0.0
*/
public static function getCustomerMenu(): array
{
$result = [];
$data = ModelMenu::field([
'menu.menu_guid',
'menu.menu_parent_guid',
'menu.menu_name',
'menu.menu_url',
'menu.menu_show',
'menu.menu_icon',
])->find(ModelMenu::CUSTOMER_MENU)->toArray();
$menu_api_url = ModelMenuApi::where([
'menu_guid' => $data['menu_guid'],
'menu_api_status' => 1
])->column('menu_api_url');
$data['menu_api_url'] = join(',', $menu_api_url);
$result[] = $data;
return $result;
}
/**
* 密码加密
*
* @param string $password
* @return string
* @date 2023-06-25
* @author xjh
* @since 1.0.0
*/
public static function encryptPassword(string $password): string
{
return md5($password);
}
}