ProjectAssociation.php
2.6 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
namespace App\Models\ProjectAssociation;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Model;
/**
* App\Models\ProjectAssociation\ProjectAssociation
*
* @property int $id
* @property int $project_id V6项目ID
* @property int $friend_id AICC朋友ID
* @property int $user_id AICC用户ID
* @property string|null $nickname AICC朋友昵称
* @property string|null $user_name AICC用户姓名
* @property string|null $image AICC朋友头像
* @property int|null $status 1 - 正常, 0 - 禁用
* @property int|null $m_status 统计当月是否生成数据
* @property int|null $binding_app 1 - 企业微信 2 - 个人微信
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @method Builder|ProjectAssociation newModelQuery()
* @method Builder|ProjectAssociation newQuery()
* @method static Builder|ProjectAssociation query()
* @method Builder|ProjectAssociation whereBindingApp($value)
* @method Builder|ProjectAssociation whereCreatedAt($value)
* @method Builder|ProjectAssociation whereFriendId($value)
* @method Builder|ProjectAssociation whereId($value)
* @method Builder|ProjectAssociation whereImage($value)
* @method Builder|ProjectAssociation whereMStatus($value)
* @method Builder|ProjectAssociation whereNickname($value)
* @method Builder|ProjectAssociation whereProjectId($value)
* @method Builder|ProjectAssociation whereStatus($value)
* @method Builder|ProjectAssociation whereUpdatedAt($value)
* @method Builder|ProjectAssociation whereUserId($value)
* @method Builder|ProjectAssociation whereUserName($value)
* @mixin \Eloquent
*/
class ProjectAssociation extends Model
{
protected $table = 'gl_project_association';
/** @var int 数据状态 - 正常 */
const STATUS_NORMAL = 1;
/** @var int 数据状态 - 禁用 */
const STATUS_DISABLED = 0;
/** @var int 企业微信 */
const ENTERPRISE_WECHAT = 1;
/** @var int 个人微信 */
const PERSONAL_WECHAT = 2;
public static function getApplicationApiUrl($app)
{
return [
1 => env('AICC_ENTERPRISE_WECHAT_FRIEND_API_URL'),
2 => env('AICC_WECHAT_FRIEND_API_URL'),
][$app];
}
/**
* 返回绑定的APP应用类型
* @param $app
* @return int
*/
public static function getApplicationID($app)
{
return [
1 => self::ENTERPRISE_WECHAT,
2 => self::PERSONAL_WECHAT,
][$app] ?? self::ENTERPRISE_WECHAT;
}
}