SyncSubmitTask.php
713 字节
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?php
/**
* Created by PhpStorm.
* User: zhl
* Date: 2024/1/5
* Time: 14:16
*/
namespace App\Models\Visit;
use App\Models\Base;
/**
* Class SyncSubmitTask
* @package App\Models\Visit
*/
class SyncSubmitTask extends Base
{
/**
* 表名
* @var string
*/
protected $table = 'gl_sync_submit_task';
const TYPE_INQUIRY = 'inquiry';
const TYPE_VISIT = 'visit';
/**
* @param $data
* @param string $type
* @return mixed
*/
public static function createTask($data, $type = self::TYPE_VISIT)
{
$task = new self();
$task->data = json_encode($data);
$task->type = $type;
$task->save();
return $task->id;
}
}