| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394 |
- <?php
- namespace addons\Alitopay\common\models;
- use Yii;
- /**
- * This is the model class for table "{{%addons_atp_apply}}".
- *
- * @property int $id
- * @property string|null $deal_sn 单号
- * @property int|null $mall_id
- * @property string $alipay_app_id 支付宝应用ID
- * @property string $company 公司名称
- * @property string $contacts 联系人
- * @property string $phone 电话
- * @property int $status 1审核中 2审核成功 3审查失败
- * @property int $is_delete 是否删除
- * @property int $created_at 创建时间
- * @property int $updated_at 更新时间
- * @property string $reason 理由
- * @property string|null $auth_url 授权url
- * @property int $auth_status 1 授权中 2授权通过
- * @property int|null $auth_time 授权时间
- * @property int|null $auth_expires_time 授权过期时间
- */
- class Apply extends \yii\db\ActiveRecord
- {
- public static $status_text = [
- 1=>'审核中',
- 2=>'审核成功',
- 3=>'审核失败'
- ];
- public static $auth_status_text = [
- 1=>'授权中',
- 2=>'授权成功',
- ];
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%addons_atp_apply}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'status', 'is_delete', 'created_at', 'updated_at', 'auth_status', 'auth_time', 'auth_expires_time'], 'integer'],
- [['alipay_app_id', 'company', 'contacts', 'phone'], 'required'],
- [['auth_url'], 'string'],
- [['deal_sn', 'alipay_app_id'], 'string', 'max' => 64],
- [['company', 'contacts', 'reason'], 'string', 'max' => 255],
- [['phone'], 'string', 'max' => 11],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'deal_sn' => '单号',
- 'mall_id' => 'Mall ID',
- 'alipay_app_id' => '支付宝应用ID',
- 'company' => '公司名称',
- 'contacts' => '联系人',
- 'phone' => '电话',
- 'status' => '1审核中 2审核成功 3审查失败 ',
- 'is_delete' => '是否删除',
- 'created_at' => '创建时间',
- 'updated_at' => '更新时间',
- 'reason' => '理由',
- 'auth_url' => '授权url',
- 'auth_status' => '1 授权中 2授权通过',
- 'auth_time' => '授权时间',
- 'auth_expires_time' => '授权过期时间',
- ];
- }
- public function getStatusText(){
- return self::$status_text[$this->status] ?? '';
- }
- public function getAuthStatusText(){
- return self::$auth_status_text[$this->auth_status] ?? '';
- }
- }
|