| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- namespace addons\AvoidTax\common\models;
- use Yii;
- use yii\helpers\Json;
- /**
- * This is the model class for table "qimall_addons_tax_ly_import_sign_user".
- *
- * @property int $id
- * @property int $mall_id
- * @property int $user_id
- * @property string $batch_num 批次号
- * @property string|null $sign_users 导入用户信息
- * @property string|null $response 返回的内容
- * @property int|null $created_at
- * @property int|null $updated_at
- */
- class LyImportSignUser extends \common\models\base\BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%addons_tax_ly_import_sign_user}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'user_id', 'batch_num'], 'required'],
- [['mall_id', 'user_id', 'created_at', 'updated_at'], 'integer'],
- [['sign_users', 'response'], 'string'],
- [['batch_num'], 'string', 'max' => 32],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'mall_id' => 'Mall ID',
- 'user_id' => 'User ID',
- 'batch_num' => 'Batch Num',
- 'sign_users' => 'Sign Users',
- 'response' => 'Response',
- 'created_at' => 'Created At',
- 'updated_at' => 'Updated At',
- ];
- }
- /**
- * 添加用户导入
- *
- * @param integer $uid
- * @param integer $mall_id
- * @param string $batch_num
- * @param array $sign_users
- * @param array $response
- * @return boolean
- */
- public static function addImportSignUser(int $uid, int $mall_id, string $batch_num, array $sign_users, array $response)
- {
- $model = new static();
- $model->user_id = $uid;
- $model->mall_id = $mall_id;
- $model->batch_num = $batch_num;
- $model->sign_users = Json::encode($sign_users);
- $model->response = Json::encode($response);
- return $model->save();
- }
- }
|