<?php
declare (strict_types=1);

namespace app\store\model\user;

use app\common\model\user\Identity as BaseIdentity;

class Identity extends BaseIdentity
{
    /**
     * @notes:新增
     * @param $data
     * @return bool
     * @author: wanghousheng
     */
    public function add($data): bool
    {
        $data['store_id'] = self::$storeId;
        return $this->save($data);
    }

    /**
     * @notes:编辑
     * @param $data
     * @return bool
     * @author: wanghousheng
     */
    public function edit($data): bool
    {
        return $this->save($data) !== false;
    }

    /**
     * @notes:删除
     * @param array $IdentityId
     * @return bool
     * @author: wanghousheng
     */
    public function remove(array $IdentityId): bool
    {
        if (static::whereIn('identity_id', $IdentityId)->delete()) {
            return true;
        }
        return false;
    }
}