Example #1
0
 /**
  * 通过关联ID获取活动产品对应的属性值
  *
  * @param int $id 活动产品关联ID
  * @return array
  */
 public function getAttrValById($id)
 {
     $result = [];
     $id = intval($id);
     if (!$id) {
         return FALSE;
     }
     $result = self::find()->where(['id' => $id, 'status' => self::STATUS_VERIFY_THROUGH])->with(['attrval' => function ($query) {
         return $query->select(['rel_id', 'attr_id', 'attr_val', 'finish_status']);
     }])->asArray()->one();
     // 解析AttrVal
     if ($result) {
         $mActiAttr = new ActivityAttrBase();
         $attrs = $mActiAttr->getAll(FALSE, 'id');
     }
     return $result;
 }
Example #2
0
 public function actionAab()
 {
     $model = new ActivityAttrBase();
     /*
             $data = array(
        'id' => 1,
        'name' => 'TEST2',
        'type' => 100,
        'widget' => 'START_TIME',
             );
     */
     // var_dump($model->store($data));
     // var_dump($model->setStatus(1, ActivityAttrBase::STATUS_DISABLE));
     var_dump($model->getAll(FALSE, 'id'));
 }