| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?php
- namespace common\models;
- /**
- * This is the model class for table "xhShop".
- *
- * @property int $id
- * @property string $businessName 门店名称,商户名称
- * @property string $branchName 分店名称
- * @property int $merchantId 商户id
- * @property string $poiId 微信门店 wifi等通用的唯一id
- * @property string $shopId shopId 适用于wifi
- * @property string $shopLat 商店的纬度
- * @property string $shopLong 商店的经度
- * @property string $shopProvince 省
- * @property string $shopCity 市
- * @property string $shopDist 区县
- * @property string $shopAddress 详细街道地址
- * @property string $telephone 电话
- * @property string $introduction 简介
- * @property int $addTime 添加时间,时间戳格式
- * @property string $createTime 创建时间
- * @property string $updateTime
- */
- class xhShop extends xhBaseModel
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return 'xhShop';
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['merchantId', 'addTime', 'status'], 'integer'],
- [['createTime'], 'required'],
- [['createTime', 'updateTime'], 'safe'],
- [['businessName', 'branchName'], 'string', 'max' => 100],
- [['poiId', 'shopId', 'shopLat', 'shopLong', 'shopProvince', 'shopCity', 'shopDist', 'shopAddress', 'telephone'], 'string', 'max' => 20],
- [['introduction'], 'string', 'max' => 800],
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'businessName' => 'Business Name',
- 'branchName' => 'Branch Name',
- 'merchantId' => 'Merchant ID',
- 'poiId' => 'Poi ID',
- 'shopId' => 'Shop ID',
- 'shopLat' => 'Shop Lat',
- 'shopLong' => 'Shop Long',
- 'shopProvince' => 'Shop Province',
- 'shopCity' => 'Shop City',
- 'shopDist' => 'Shop Dist',
- 'shopAddress' => 'Shop Address',
- 'telephone' => 'Telephone',
- 'introduction' => 'Introduction',
- 'status' => 'Shop Status',
- 'addTime' => 'Add Time',
- 'createTime' => 'Create Time',
- 'updateTime' => 'Update Time',
- ];
- }
- public static function updateByPoiId($poiId, $data){
- $cond = ['poiId' => $poiId];
- return self::updateByCondition($cond, $data);
- }
- public static function getByPoiId($poiId)
- {
- $condition = ['poiId' => $poiId];
- return self::find()->where($condition)->asArray()->one();
- }
- }
|