| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- use app\utils\Notice\NoticeSend;
- use yii\behaviors\TimestampBehavior;
- /**
- * Class StoreAliMini
- * @package app\models
- * @property integer $id
- * @property string $wechat_open_id
- * @property string $wechat_platform_open_id
- * @property string $ali_openId
- * @property string $ali_user_id
- * @property integer $store_id
- * @property string $avatar
- * @property string $mobile
- * @property integer $status
- * @property integer $type
- * @property integer $user_id
- * @property integer $custom_form
- * @property integer $is_delete
- * @property string $pass_remark
- * @property string $audit_time
- * @property string $created_at
- * @property string $updated_at
- *
- *
- **/
- class UserAuditLog extends \yii\db\ActiveRecord
- {
- const STATUS_NOT_AUDIT = -1;//未处理
- const STATUS_NOT_AGREE = 0;//未通过
- const STATUS_AGREE = 1;//通过
- const STATUS_PASS = 2;//已拒绝
- const STATUS_ARR = [
- self::STATUS_NOT_AUDIT,
- self::STATUS_NOT_AGREE,
- self::STATUS_AGREE,
- self::STATUS_PASS
- ];
- const TYPE_H5 = 0;//h5来源
- const TYPE_WX = 1;//微信来源
- const TYPE_ALI = 2;//支付宝来源
- const TYPE_APP = 3;//APP来源
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return '{{%user_audit_log}}';
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['id', 'store_id', 'status', 'type', 'user_id', 'is_delete'], 'integer'],
- [['avatar', 'created_at', 'updated_at', 'audit_time', 'pass_remark', 'custom_form', 'wechat_open_id', 'ali_openId', 'ali_user_id', 'wechat_platform_open_id', 'mobile'], 'string']
- ];
- }
- public function behaviors()
- {
- return [
- [
- 'class' => TimestampBehavior::class
- ]
- ];
- }
- public function afterSave($insert, $changedAttributes)
- {
- parent::afterSave($insert, $changedAttributes);
- if (!$insert && isset($changedAttributes['status']) && in_array($this->status, [self::STATUS_AGREE, self::STATUS_PASS])) {
- NoticeSend::userAuditStatusNotice($this->id, $this->store_id);
- } else {
- NoticeSend::userAuditNotice($this->id, $this->store_id);
- }
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => '',
- 'wechat_open_id' => '微信openid',
- 'wechat_platform_open_id' => '微信公众号openid',
- 'ali_openId' => '支付宝openid',
- 'ali_user_id' => '支付宝userid',
- 'store_id' => '绑定店铺',
- 'mobile' => '手机号',
- 'status' => '状态0未审核 1已通过 2已拒绝',
- 'type' => '来源:0:h5 1:微信 2:支付宝',
- 'user_id' => '绑定的user_id',
- 'is_delete' => '是否删除',
- 'pass_remark' => '拒绝原因',
- 'created_at' => '',
- 'updated_at' => '',
- 'audit_time' => '审核时间'
- ];
- }
- }
|