BalanceLogSceneEnum::data(), ]; } /** * 与代理商关联 * @return \think\model\relation\BelongsTo */ public function agent() { return $this->hasOne(Agent::class, 'agent_id', 'agent_id'); } /** * 余额变动场景 */ public function getSceneAttr($value) { return ['text' => BalanceLogSceneEnum::data()[$value]['name'], 'value' => $value]; } /** * 新增记录 */ public static function add($scene, $data, $describeParam) { $model = new static; $model->save(array_merge([ 'scene' => $scene, 'describe' => $describeParam, 'app_id' => 0 ], $data)); } }