Merge branch 'develop'
This commit is contained in:
@@ -2,19 +2,13 @@
|
||||
|
||||
namespace app\controller;
|
||||
|
||||
use app\common\model\InquiryLog;
|
||||
use app\common\model\User;
|
||||
use app\common\model\UserRoles;
|
||||
use app\common\model\UserSystems;
|
||||
use app\common\service\MessageNotificationsService;
|
||||
use app\common\traits\DataPermission;
|
||||
use app\common\utils\email\MailSend;
|
||||
use app\common\model\Resource;
|
||||
use app\common\service\SysDictService;
|
||||
use app\common\service\UploadService;
|
||||
use app\common\utils\scaffold\Generate;
|
||||
use support\Request;
|
||||
use support\Db;
|
||||
use support\Cache;
|
||||
use app\inquiry\service\InquiryLogService;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
|
||||
class IndexController
|
||||
{
|
||||
@@ -77,26 +71,26 @@ class IndexController
|
||||
{
|
||||
$options = [
|
||||
'controller' => [
|
||||
'module' => 'common',
|
||||
'name' => 'message_notifications'
|
||||
'module' => 'crm',
|
||||
'name' => 'approval_flows'
|
||||
],
|
||||
'model' => [
|
||||
'module' => 'common',
|
||||
'name' => 'message_notifications'
|
||||
'module' => 'crm',
|
||||
'name' => 'approval_flows'
|
||||
],
|
||||
'service' => [
|
||||
'module' => 'common',
|
||||
'name' => 'message_notifications'
|
||||
'module' => 'crm',
|
||||
'name' => 'approval_flows'
|
||||
],
|
||||
'logic' => [
|
||||
'module' => 'common',
|
||||
'name' => 'message_notifications'
|
||||
'module' => 'crm',
|
||||
'name' => 'approval_flows'
|
||||
],
|
||||
'validate' => [
|
||||
'module' => 'common',
|
||||
'name' => 'message_notifications'
|
||||
'module' => 'crm',
|
||||
'name' => 'approval_flows'
|
||||
],
|
||||
'table' => 'message_notifications'
|
||||
'table' => 'approval_flows'
|
||||
];
|
||||
|
||||
$result = (new Generate($options))->doGenerate();
|
||||
@@ -104,45 +98,58 @@ class IndexController
|
||||
}
|
||||
|
||||
|
||||
public function test()
|
||||
public function test2(Request $request)
|
||||
{
|
||||
|
||||
// $data = [
|
||||
// 'sender_id' => 0,
|
||||
// 'sender_type' => 'system',
|
||||
// 'title' => '测试消息 - 标题',
|
||||
// 'content' => '测试消息 - 内容',
|
||||
// 'scene' => 1,
|
||||
// 'recipient' => [1],
|
||||
// ];
|
||||
|
||||
// $data['recipient'] = [1, 74];
|
||||
// // // 同步推送
|
||||
// // (new MessageNotificationsService())->pushNotice($data);
|
||||
|
||||
|
||||
|
||||
// // 异步推送
|
||||
// \Webman\RedisQueue\Redis::send('notice', $data);
|
||||
$where[] = ['id', '>', 141];
|
||||
$list = (new \app\common\utils\MigrationResources())->getFullResourceTreeOptimized('resources', $where);
|
||||
|
||||
|
||||
$info = InquiryLog::with(['channelInfo', 'countryInfo', 'enter'])->where('id', 1)->where('sync_crm', 0)->first();
|
||||
$keys = ['system_id','name','desc','type','code','parent_id','url','icon','open_type','link',
|
||||
'is_hide','is_hide_tab','no_auth','is_home','instance','keep_alive','sort','status'];
|
||||
foreach ($list as $key=>$item) {
|
||||
|
||||
var_dump(empty($info->recipient));
|
||||
|
||||
$temp = [];
|
||||
|
||||
if ($info) {
|
||||
var_dump(11);
|
||||
} else {
|
||||
var_dump(22);
|
||||
foreach ($item as $k=>$v) {
|
||||
|
||||
if (isset($item['children']) && count($item['children']) > 0) {
|
||||
$temp = $item['children'];
|
||||
}
|
||||
|
||||
if (!in_array($k, $keys)) {
|
||||
unset($item[$k]);
|
||||
}
|
||||
|
||||
$id = Db::table('resources')->insertGetId($item);
|
||||
|
||||
if ($temp) {
|
||||
foreach ($temp as $kc=>$vc) {
|
||||
|
||||
foreach ($vc as $kk => $vv) {
|
||||
if (!in_array($kk, $keys)) {
|
||||
unset($vc[$kk]);
|
||||
}
|
||||
}
|
||||
|
||||
$vc['parent_id'] = $id;
|
||||
|
||||
Db::table('resources')->insert($vc);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($info !== NULL) {
|
||||
var_dump(33);
|
||||
} else {
|
||||
var_dump(44);
|
||||
}
|
||||
|
||||
return json(['code' => 0, 'msg' => 'success']);
|
||||
public function test(Request $request)
|
||||
{
|
||||
// 菜单迁移
|
||||
$where[] = ['id', '>', 141];
|
||||
$list = (new \app\common\utils\MigrationResources())->do('resources_20250916_bak', 'resources_yuanshi', $where);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user