first commit

This commit is contained in:
2026-05-07 16:37:25 +08:00
commit 822ed9a099
67 changed files with 1799 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
<?php
namespace app\common\model;
use think\Model;
use app\common\model\CustomerEmployees;
class Customers extends Model
{
protected $table = 'customers';
public function employees()
{
return $this->hasMany(CustomerEmployees::class, 'customer_id', 'id');
}
/* 模型事件:在删除客户记录之后执行 */
public static function onAfterDelete($customer)
{
// 删除与该客户相关的员工记录
$customer->employees()->delete();
}
public function getCompanyOfAccount(){
return $this->hasMany(User::class,'company_id','id');
}
}