quanwei
2025-12-25 dd6fdd9bcff3c2b3dcebdb0db3f80bc9dd469bc4
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
<?php
 
namespace app\common\model\supplier;
 
use app\common\model\BaseModel;
/**
 * 供应商资金明细模型
 */
class Capital extends BaseModel
{
    protected $name = 'supplier_capital';
    protected $pk = 'id';
 
    /**
     * 关联商户表
     */
    public function supplier()
    {
        return $this->belongsTo('app\\common\\model\\supplier\\Supplier', 'shop_supplier_id', 'shop_supplier_id');
    }
 
    /**
     * 分销商资金明细
     * @param $data
     */
    public static function add($data)
    {
        $model = new static;
        $model->save(array_merge([
            'app_id' => $model::$app_id
        ], $data));
    }
}