255], [['remark'], 'string'], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'user_id' => 'User ID', 'money' => 'Money', 'status' => 'Status', 'store_id' => 'Store ID', 'commission_status' => 'Commission Status', 'commission_type' => 'Commission Type', 'mall_id' => 'Mall ID', 'agent_id' => 'Agent ID', 'order_no' => 'Order No', 'order_id' => 'Order ID', 'order_money' => 'Order Money', 'send_time' => 'Send Time', 'remark' => 'Remark', 'created_at' => 'Created At', 'updated_at' => 'Updated At', ]; } public function getUser() { return $this->hasOne(User::class, ['id' => 'user_id']); } public function getStore() { return $this->hasOne(HappinessStore::class, ['id' => 'store_id']); } public static function setData($params) { try { if (isset($params['id']) && !empty($params['id'])) $model = self::findOne($params['id']); else { $model = new self(); $model->loadDefaultValues(); } if (!$model->load($params, '') || !$model->save()) { throw new \Exception($model->getErrorMessage()); } return $model; } catch (\Exception $e) { self::$static_error = $e->getMessage(); return false; } } }