liyaozhi
2025-10-28 1320688354fd168c51cf2e05f29a2253f4ed9c00
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\branch;
 
use app\common\model\BaseModel;
/**
 * 供应商资金明细模型
 */
class Capital extends BaseModel
{
    protected $name = 'branch_capital';
    protected $pk = 'id';
 
    /**
     * 关联商户表
     */
    public function branch()
    {
        return $this->belongsTo('app\\common\\model\\branch\\Branch', 'branch_id', 'branch_id');
    }
 
    /**
     * 分销商资金明细
     * @param $data
     */
    public static function add($data)
    {
        $model = new static;
        $model->save(array_merge([
            'app_id' => $model::$app_id
        ], $data));
    }
}