quanwei
2025-12-09 ca425b889f3c1b5847ffc26a0229307f7f8ef43e
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
<?php
 
namespace app\common\model\supplier;
 
use app\common\model\BaseModel;
 
class PointsLog extends BaseModel
{
    protected $name = 'supplier_points_log';
    protected $pk = 'log_id';
    protected $updateTime = false;
 
    /**
     * 关联商户记录表
     */
    public function supplier()
    {
        $module = self::getCalledModule() ?: 'common';
        return $this->belongsTo("app\\{$module}\\model\\supplier\\Supplier", 'shop_supplier_id', 'shop_supplier_id');
    }
 
    /**
     * 新增记录
     */
    public static function add($data)
    {
        $static = new static;
        $static->save(array_merge(['app_id' => $static::$app_id], $data));
    }
 
    /**
     * 新增记录 (批量)
     */
    public function onBatchAdd($saveData)
    {
        return $this->saveAll($saveData);
    }
 
}