mirror of
https://github.com/easychen/pushdeer.git
synced 2025-02-23 00:14:56 +08:00
fix type & message
This commit is contained in:
parent
a9981dd7ba
commit
eda58634dc
@ -56,17 +56,18 @@ class PushDeerMessageController extends Controller
|
|||||||
$result = false;
|
$result = false;
|
||||||
|
|
||||||
if ($key) {
|
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();
|
$devices = PushDeerDevice::where('uid', $key->uid)->get();
|
||||||
|
|
||||||
foreach ($devices as $device) {
|
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) {
|
if ($device) {
|
||||||
$result[] = ios_send($device->is_clip, $device->device_id, $validated['text']);
|
$result[] = ios_send($device->is_clip, $device->device_id, $validated['text']);
|
||||||
}
|
}
|
||||||
|
@ -15,5 +15,6 @@ class PushDeerMessage extends Model
|
|||||||
'text',
|
'text',
|
||||||
'desp',
|
'desp',
|
||||||
'uid',
|
'uid',
|
||||||
|
'type',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user