Merge branch 'develop'

This commit is contained in:
mzl
2025-07-29 09:00:04 +08:00
parent a551507e4d
commit d74b374198
106 changed files with 6754 additions and 1346 deletions
+11 -1
View File
@@ -46,4 +46,14 @@ class Corp extends Model
public $timestamps = true;
}
protected $dateFormat = 'U';
protected $fillable = [
'name',
'abbr',
'tenant_key',
'sort',
'status'
];
}
+49
View File
@@ -0,0 +1,49 @@
<?php
namespace app\common\model;
use support\Model;
class Country extends Model
{
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'mysql';
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'country';
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'id';
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
public $timestamps = true;
protected $dateFormat = 'U';
/**
* 允许自动填充模型字段
*/
protected $fillable = ['id', 'cn_addr', 'en_addr', 'en_full_name', 'two_letter', 'three_letter', 'num_code', 'steering', 'c_time', 'u_time'];
/**
* 不允许自动填充模型字段
*/
protected $guarded = [];
}
+49
View File
@@ -0,0 +1,49 @@
<?php
namespace app\common\model;
use support\Model;
class CrmCustomer extends Model
{
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'mysql';
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'crm_customer';
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'id';
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
public $timestamps = true;
protected $dateFormat = 'U';
/**
* 允许自动填充模型字段
*/
protected $fillable = ['id', 'sn', 'corp_abbr', 'user_id', 'user_sn', 'type', 'grade', 'sex', 'channel_id', 'country_id', 'car_type_id', 'magnitude', 'email', 'phone', 'WhatsApp', 'contacts', 'describe', 'desc_collect', 'address', 'lat', 'lng', 'follow_last', 'follow_next', 'warn', 'follow_remark', 'enter_user_id', 'created_at', 'updated_at', 'deleted_at'];
/**
* 不允许自动填充模型字段
*/
protected $guarded = [];
}
+49
View File
@@ -0,0 +1,49 @@
<?php
namespace app\common\model;
use support\Model;
class InquiryChannel extends Model
{
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'mysql';
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'inquiry_channel';
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'id';
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
public $timestamps = true;
protected $dateFormat = 'U';
/**
* 允许自动填充模型字段
*/
protected $fillable = ['id', 'name', 'sort', 'status', 'created_at', 'updated_at'];
/**
* 不允许自动填充模型字段
*/
protected $guarded = [];
}
+77
View File
@@ -0,0 +1,77 @@
<?php
namespace app\common\model;
use support\Model;
use app\common\model\User;
use app\common\model\Country;
class InquiryLog extends Model
{
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'mysql';
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'inquiry_log';
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'id';
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
public $timestamps = true;
protected $dateFormat = 'U';
/**
* 允许自动填充模型字段
*/
protected $fillable = [
'id', 'order_no', 'enter_user_id', 'recipient',
'quality', 'channel', 'email', 'tel', 'whatsapp',
'country', 'contacts', 'content', 'status',
'r_time', 't_time', 'created_at', 'updated_at'
];
/**
* 不允许自动填充模型字段
*/
protected $guarded = [];
public function enter()
{
return $this->hasOne(User::class, 'id', 'enter_user_id');
}
public function recipient()
{
return $this->hasOne(User::class, 'id', 'recipient');
}
public function channelInfo()
{
return $this->hasOne(InquiryChannel::class, 'id', 'channel');
}
public function countryInfo()
{
return $this->hasOne(Country::class, 'id', 'country');
}
}
+9 -1
View File
@@ -43,6 +43,14 @@ class Role extends Model
public $timestamps = true;
protected $dateFormat = 'U';
protected $fillable = [
'system_id',
'name',
'desc',
'sort',
'status'
];
// 角色下所有用户
public function users()
@@ -53,6 +61,6 @@ class Role extends Model
// 角色拥有的资源(权限点、菜单)
public function resources()
{
return $this->belongsToMany(Resource::class, 'role_resources', 'role_id', 'resource_id')->orderBy('sort', 'asc');
return $this->belongsToMany(Resource::class, 'role_resources', 'role_id', 'resource_id');
}
}
+11 -26
View File
@@ -4,21 +4,6 @@ namespace app\common\model;
use support\Model;
/**
* systems 系统/应用表
* @property integer $id 系统ID(主键)
* @property string $code 系统编码(唯一英文标识)
* @property string $name 系统名称
* @property string $type 系统类型
* @property string $desc 系统描述
* @property string $icon 系统图标
* @property string $domain_url 系统URL
* @property string $is_role 是否区分角色权限
* @property integer $sort 排序
* @property integer $status 状态
* @property integer $created_at 创建时间
* @property integer $updated_at 更新时间
*/
class Systems extends Model
{
/**
@@ -50,15 +35,15 @@ class Systems extends Model
public $timestamps = true;
// 系统下的资源
public function resources()
{
return $this->hasMany(Resource::class, 'system_id', 'id');
}
protected $dateFormat = 'U';
// 拥有该系统访问权限的用户
public function users()
{
return $this->belongsToMany(User::class, 'user_systems', 'system_id', 'user_id');
}
}
/**
* 允许自动填充模型字段
*/
protected $fillable = ['id', 'code', 'name', 'type', 'desc', 'icon', 'domain_url', 'is_role', 'sort', 'status', 'created_at', 'updated_at'];
/**
* 不允许自动填充模型字段
*/
protected $guarded = [];
}
+7 -2
View File
@@ -54,6 +54,7 @@ class User extends Model
'sn',
'name',
'avatar',
'sex',
'password',
'phone',
'email',
@@ -63,7 +64,11 @@ class User extends Model
'union_id',
'user_id',
'open_id',
'tenant_key'
'tenant_key',
'country_id',
'position',
'socialize',
'socialize_pic',
];
// 用户所有角色
@@ -91,4 +96,4 @@ class User extends Model
->orWhere('phone', $account)
->orWhere('email', $account);
}
}
}
-69
View File
@@ -1,69 +0,0 @@
<?php
namespace app\common\model;
use support\Model;
/**
* user_feishu_app 用户-飞书应用
* @property integer $id ID(主键)
* @property integer $uid 用户ID
* @property integer $corp_id 公司ID
* @property string $name 名称
* @property string $mobile 手机
* @property string $union_id ISV的唯一标识
* @property string $user_id 用户 user_id
* @property string $open_id 应用内的唯一标识
* @property string $tenant_key 当前企业标识
* @property integer $sort 排序
* @property integer $status 状态
* @property integer $created_at 创建时间
* @property integer $updated_at 更新时间
*/
class UserFeishuApp_bak extends Model
{
/**
* The connection name for the model.
*
* @var string|null
*/
protected $connection = 'mysql';
/**
* The table associated with the model.
*
* @var string
*/
protected $table = 'user_feishu_app';
/**
* The primary key associated with the table.
*
* @var string
*/
protected $primaryKey = 'id';
/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
public $timestamps = true;
protected $dateFormat = 'U';
protected $fillable = [
'uid',
'corp_id',
'name',
'mobile',
'union_id',
'user_id',
'open_id',
'tenant_key',
'sort',
'status'
];
}