Пример #1
0
 /**
  * The default implementation returns the names of the columns whose values have been populated into MessageTemplate.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['id' => function ($model) {
         return (string) $model->_id;
     }, 'name', 'weChat', 'email', 'mobile', 'useWebhook', 'updatedAt' => function ($model) {
         return MongodbUtil::MongoDate2String($model->updatedAt);
     }]);
 }
Пример #2
0
 /**
  * The default implementation returns the names of the columns whose values have been populated into question.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['title', 'type', 'options' => function () {
         return empty($this->options) ? [] : $this->options;
     }, 'createdAt' => function () {
         return MongodbUtil::MongoDate2String($this->createdAt, 'Y-m-d H:i:s');
     }, 'order']);
 }
Пример #3
0
 public function fields()
 {
     return array_merge(parent::fields(), ['creator', 'action', 'description', 'createdAt' => function ($model) {
         return MongodbUtil::MongoDate2msTimeStamp($model['createdAt']);
     }, 'issueId' => function ($model) {
         return $model['issueId'] . '';
     }]);
 }
Пример #4
0
 /**
  * The default implementation returns the names of the columns whose values have been populated into statsCouponLogDaily.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['couponId', 'recievedNum', 'redeemedNum', 'date' => function () {
         return MongodbUtil::MongoDate2String($this->date);
     }, 'createdAt' => function () {
         return MongodbUtil::MongoDate2String($this->createdAt);
     }]);
 }
Пример #5
0
 /**
  * The default implementation returns the names of the columns whose values have been populated into memberLogs.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['memberId', 'operation', 'operationAt' => function ($model) {
         return MongodbUtil::MongoDate2String($model->operationAt);
     }, 'createdAt' => function ($model) {
         return MongodbUtil::MongoDate2String($model->createdAt);
     }]);
 }
Пример #6
0
 /**
  * The default implementation returns the names of the columns whose values have been populated into Member.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['assigner', 'increment', 'brief', 'description', 'channel', 'user' => function () {
         $user = $this->user;
         if (!empty($user)) {
             $user['id'] = (string) $user['id'];
         }
         return $user;
     }, 'createdAt' => function ($model) {
         return MongodbUtil::MongoDate2String($model->createdAt);
     }]);
 }
Пример #7
0
 /**
  * The default implementation returns the names of the columns whose values have been populated into tradeRefund.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['refundNumber', 'subject', 'transactionId', 'user', 'refundAccount', 'admin' => function () {
         $admin = $this->admin;
         if (isset($admin['id'])) {
             $admin['id'] = (string) $admin['id'];
         }
         return $admin;
     }, 'expectedAmount', 'realAmount', 'refundMode', 'comments', 'orderNumber', 'createdAt' => function () {
         return MongodbUtil::MongoDate2String($this->createdAt, 'Y-m-d H:i:s');
     }, 'refundAt' => function () {
         return MongodbUtil::MongoDate2String($this->refundAt, 'Y-m-d H:i:s');
     }]);
 }
Пример #8
0
 /**
  * The default implementation returns the names of the columns whose values have been populated into Notification.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['title', 'content', 'isRead', 'status', 'sender' => function ($model) {
         return ['id' => empty($model->sender['id']) ? '' : (string) $model->sender['id'], 'from' => empty($model->sender['from']) ? '' : $model->sender['from']];
     }, 'to' => function ($model) {
         return ['id' => empty($model->to['id']) ? '' : (string) $model->to['id'], 'target' => empty($model->to['target']) ? '' : $model->to['target']];
     }, 'accountId' => function ($model) {
         return (string) $model->accountId;
     }, 'createdAt' => function ($model) {
         return MongodbUtil::MongoDate2String($model->createdAt, 'Y-m-d H:i:s');
     }, 'readAt' => function ($model) {
         return MongodbUtil::MongoDate2String($model->readAt, 'Y-m-d H:i:s');
     }]);
 }
Пример #9
0
 /**
  * The default implementation returns the names of the columns whose values have been populated into GoodsExchangeLog.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['goods' => function () {
         $goods = $this->goods;
         foreach ($goods as &$item) {
             $item['id'] = (string) $item['id'];
             $item['productId'] = (string) $item['productId'];
         }
         return $goods;
     }, 'memberId' => function () {
         return (string) $this->memberId;
     }, 'createdAt' => function () {
         return MongodbUtil::MongoDate2String($this->createdAt, 'Y-m-d H:i:s');
     }, 'memberName', 'telephone', 'usedScore', 'count', 'usedFrom', 'expectedScore', 'address', 'postcode', 'isDelivered', 'receiveMode']);
 }
Пример #10
0
 /**
  * The default implementation returns the names of the columns whose values have been populated into questionnaire.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['name', 'startTime' => function () {
         return MongodbUtil::MongoDate2String($this->startTime, 'Y-m-d H:i:s');
     }, 'endTime' => function () {
         return MongodbUtil::MongoDate2String($this->endTime, 'Y-m-d H:i:s');
     }, 'creator' => function ($model) {
         $creator = $model->creator;
         $creator['id'] .= '';
         return $creator;
     }, 'description', 'questions' => function () {
         return self::getByOrder($this->questions);
     }, 'isPublished', 'createdAt' => function () {
         return MongodbUtil::MongoDate2String($this->createdAt, 'Y-m-d H:i:s');
     }]);
 }
Пример #11
0
 /**
  * The default implementation returns the names of the columns whose values have been populated into couponLog.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['couponId' => function () {
         $couponId = (string) $this->couponId;
         return $couponId;
     }, 'membershipDiscountId' => function () {
         return (string) $this->membershipDiscountId;
     }, 'type', 'title', 'status', 'member' => function () {
         $member = $this->member;
         $member['id'] .= '';
         return $member;
     }, 'store', 'total', 'operationTime' => function () {
         return MongodbUtil::MongoDate2String($this->operationTime);
     }, 'createdAt' => function () {
         return MongodbUtil::MongoDate2String($this->createdAt);
     }]);
 }
Пример #12
0
 /**
  * The default implementation returns the names of the columns whose values have been populated into membershipDiscount.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['qrcode' => function () {
         $qrcode = $this->qrcode;
         if (!empty($qrcode)) {
             $qrcode['_id'] = (string) $qrcode['_id'];
             $qrcode['url'] = Yii::$app->qrcode->getUrl($qrcode['qiniuKey']);
             unset($qrcode['qiniuKey']);
         }
         return $qrcode;
     }, 'code', 'coupon' => function () {
         $coupon = $this->coupon;
         $coupon['id'] .= '';
         $coupon['startTime'] = MongodbUtil::MongoDate2String($coupon['startTime'], 'Y-m-d H:i:s');
         $coupon['endTime'] = MongodbUtil::MongoDate2String($coupon['endTime'], 'Y-m-d H:i:s');
         return $coupon;
     }, 'createdAt' => function () {
         return MongodbUtil::MongoDate2String($this->createdAt, 'Y-m-d H:i:s');
     }]);
 }
Пример #13
0
 /**
  * The default implementation returns the names of the columns whose values have been populated into campaignLog.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['code', 'member' => function () {
         $member = $this->member;
         if ($member) {
             $member['id'] .= '';
         }
         return $member;
     }, 'product' => function () {
         return ['id' => (string) $this->productId, 'name' => $this->productName, 'sku' => $this->sku];
     }, 'usedFrom', 'redeemTime' => function () {
         if (!empty($this->redeemTime)) {
             return MongodbUtil::MongoDate2String($this->redeemTime, 'Y-m-d H:i:s');
         } else {
             return MongodbUtil::MongoDate2String($this->createdAt, 'Y-m-d H:i:s');
         }
     }, 'createdAt' => function () {
         return MongodbUtil::MongoDate2String($this->createdAt, 'Y-m-d H:i:s');
     }]);
 }
 /**
  * The default implementation returns the names of the columns whose values have been populated into statsMemberCampaignLogDaily.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['memberId', 'memProperty', 'productId', 'code', 'year', 'quarter', 'month']);
 }
 /**
  * The default implementation returns the names of the columns whose values have been populated into statsMemberGrowthQuarterly.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['totalNew', 'totalActive', 'totalInactive', 'year', 'quarter', 'createdAt' => function ($model) {
         return MongodbUtil::MongoDate2String($model->createdAt);
     }]);
 }
Пример #16
0
 /**
  * The default implementation returns the names of the columns whose values have been populated into promotionCode.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['productId' => function () {
         return $this->productId . '';
     }, 'createdAt' => function () {
         return MongodbUtil::MongoDate2String($this->createdAt, 'Y-m-d H:i:s');
     }, 'code', 'isUsed', 'usedBy', 'usedAt']);
 }
Пример #17
0
 public function fields()
 {
     return array_merge(parent::fields(), ['request', 'response', 'deviceType']);
 }
 /**
  * The default implementation returns the names of the columns whose values have been populated into statsMemberPropAvgTradeQuaterly.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['propName', 'propValue', 'productId', 'productName', 'avg', 'year', 'quarter']);
 }
Пример #19
0
 /**
  * The default implementation returns the names of the columns whose values have been populated into statsMemberMonthly.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['month', 'origin', 'originName', 'total', 'createdAt' => function ($model) {
         return MongodbUtil::MongoDate2String($model->createdAt);
     }]);
 }
Пример #20
0
 /**
  * The default implementation returns the names of the columns whose values have been populated into user.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['nick', 'avatar', 'openId', 'source', 'sourceChannel', 'accountInfo', 'lastPingTime', 'tags', 'requestTime' => function ($model) {
         return MongodbUtil::MongoDate2TimeStamp($model->requestTime);
     }]);
 }
Пример #21
0
 /**
  * The default implementation returns the names of the columns whose values have been populated into captcha.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['ip', 'mobile', 'code', 'isExpired']);
 }
Пример #22
0
 /**
  * The default implementation returns the names of the columns whose values have been populated into TradePayment.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['orderNumber', 'transactionId', 'expectedAmount', 'realAmount', 'subject', 'payMode', 'payAccount', 'status', 'user' => function () {
         $user = $this->user;
         if (!empty($user['memberId'])) {
             $user['memberId'] = (string) $user['memberId'];
         }
         return $user;
     }, 'timeExpire' => function () {
         return MongodbUtil::MongoDate2String($this->createdAt);
     }, 'createdAt' => function () {
         return MongodbUtil::MongoDate2String($this->createdAt);
     }, 'paymentTime' => function () {
         return MongodbUtil::MongoDate2String($this->paymentTime);
     }, 'couponId' => function () {
         return (string) $this->couponId;
     }]);
 }
Пример #23
0
 public function fields()
 {
     return array_merge(parent::fields(), ['email', 'phone', 'name', 'avatar', 'company', 'origin']);
 }
Пример #24
0
 /**
  * The default implementation returns the names of the columns whose values have been populated into statsMemberOrder.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['consumerCount', 'consumptionAmount', 'transactionCount', 'maxConsumptionTotal', 'recentTransactionTotal']);
 }
 /**
  * The default implementation returns the names of the columns whose values have been populated into statsQuestionnaireDaily.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['questionnaireId' => function () {
         return (string) $this->questionnaireId;
     }, 'count', 'date']);
 }
 /**
  * The default implementation returns the names of the columns whose values have been populated into statsMemberPropTradeQuarterly.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['propId', 'propValue', 'total', 'year', 'quarter']);
 }
Пример #27
0
 public function fields()
 {
     return array_merge(parent::fields(), ['memberId', 'gameId', 'token', 'isUsed', 'validFrom', 'validTo']);
 }
Пример #28
0
 /**
  * The default implementation returns the names of the columns whose values have been populated into questionnaireLog.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['questionnaireId', 'user', 'answers']);
 }
Пример #29
0
 /**
  * The default implementation returns the names of the columns whose values have been populated into channel.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['channelId', 'origin', 'name', 'type', 'status', 'isTest']);
 }
 /**
  * The default implementation returns the names of the columns whose values have been populated into PromotionCodeAnalysis.
  */
 public function fields()
 {
     return array_merge(parent::fields(), ['productId', 'campaignId', 'total', 'productName', 'type', 'createdAt' => function () {
         return MongodbUtil::MongoDate2String($this->createdAt);
     }]);
 }