24 lines
597 B
PHP
24 lines
597 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use \Illuminate\Support\Facades\Log;
|
|
|
|
class Message extends Model
|
|
{
|
|
public function addMsg($data){
|
|
try {
|
|
$tmp = [];
|
|
foreach ($data as $d => $v) {
|
|
$tmp['mobile'] = $v['mobile'];
|
|
$tmp['app_code'] = $v['token'];
|
|
$tmp['address'] = $v['from'];
|
|
$tmp['content'] = $v['content'];
|
|
}
|
|
$this->save($tmp);
|
|
} catch (\Exception $e) {
|
|
Log::channel('smslog')->info('内容',$data);
|
|
}
|
|
}
|
|
} |