|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103 |
- <?php
- /**
- * 数据库表类 fx_user
- * ============================================================================
- * * 版权所有 蜘蛛出行 * *
- * 网站地址: http://www.zhizhuchuxing.com
- * ----------------------------------------------------------------------------
- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
- * 使用;不允许对程序代码以任何形式任何目的的再发布。
- * ============================================================================
- * Author By: 倪宗锋
- * PhpStorm LoginController.php
- * Create By 2017/10/17 15:08 $
- */
-
- namespace common\models;
-
- use yii\db\ActiveRecord;
-
- /**
- * 数据库表类 fx_user.
- * @property integer $uid
- * @property string $user_name
- * @property string $openid
- * @property string $phone
- * @property string $nickname
- * @property string $headimgurl
- * @property integer $sex
- * @property string $country
- * @property string $province
- * @property string $city
- * @property integer $status
- * @property string $reg_time
- * @property integer $delete_flag
- * @property string $wx_openid
- * @property integer $main_user_id
- */
- class FxUser extends ActiveRecord
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return 'fx_user';
- }
-
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['openid'], 'required'],
- [['sex', 'status', 'delete_flag', 'main_user_id'], 'integer'],
- [['reg_time'], 'safe'],
- [['user_name'], 'string', 'max' => 100],
- [['openid', 'wx_openid'], 'string', 'max' => 120],
- [['phone'], 'string', 'max' => 11],
- [['nickname'], 'string', 'max' => 21],
- [['headimgurl', 'country', 'province', 'city'], 'string', 'max' => 255],
- [['openid'], 'unique'],
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'uid' => 'Uid',
- 'user_name' => 'User Name',
- 'openid' => 'Openid',
- 'phone' => 'Phone',
- 'nickname' => 'Nickname',
- 'headimgurl' => 'Headimgurl',
- 'sex' => 'Sex',
- 'country' => 'Country',
- 'province' => 'Province',
- 'city' => 'City',
- 'status' => 'Status',
- 'reg_time' => 'Reg Time',
- 'delete_flag' => 'Delete Flag',
- 'wx_openid' => 'Wx Openid',
- 'main_user_id' => 'Main User ID',
- ];
- }
-
- /**
- * Des:修改用户数据
- * Name: updateById
- * @param $value
- * @param $id
- * @return int
- * @author 倪宗锋
- */
- public function updateById($value, $id)
- {
- $count = self::updateAll($value, ['in', 'uid', $id]);
- return $count;
- }
- }
|