BtEvents.php 683 字节
<?php
/**
 * Created by PhpStorm.
 * User: zhl
 * Date: 2022/11/03
 * Time: 09:53
 */
namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * Class BtEvents
 * @package App\Models
 */
class BtEvents extends Model
{
    /**
     * @var string $table
     */
    protected $table = 'bt_events';

    const STATUS_INIT = 0;
    const STATUS_FINISH = 1;
    const STATUS_ERROR = 9;

    /**
     * @param $type
     * @param $param
     * @return mixed
     */
    public static function createBtEvent($type, $param)
    {
        $event = new self();
        $event->type = $type;
        $event->param = $param;
        $event->save();
        return $event->id;
    }
}