fix type & message

This commit is contained in:
Easy 2022-01-09 17:39:12 +08:00
parent a9981dd7ba
commit eda58634dc
2 changed files with 10 additions and 8 deletions

View File

@ -56,17 +56,18 @@ class PushDeerMessageController extends Controller
$result = false;
if ($key) {
$readkey = Str::random(32);
$the_message = [];
$the_message['uid'] = $key->uid;
$the_message['text'] = $validated['text'];
$the_message['desp'] = $validated['desp'];
$the_message['type'] = $validated['type'];
$the_message['readkey'] = $readkey;
$pd_message = Message::create($the_message);
$devices = PushDeerDevice::where('uid', $key->uid)->get();
foreach ($devices as $device) {
$readkey = Str::random(32);
$the_message = [];
$the_message['uid'] = $key->uid;
$the_message['text'] = $validated['text'];
$the_message['desp'] = $validated['desp'];
$the_message['readkey'] = $readkey;
$pd_message = Message::create($the_message);
if ($device) {
$result[] = ios_send($device->is_clip, $device->device_id, $validated['text']);
}

View File

@ -15,5 +15,6 @@ class PushDeerMessage extends Model
'text',
'desp',
'uid',
'type',
];
}