255], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'id' => 'ID', 'store_id' => '店铺id', 'user_id' => '用户id', 'wechat_open_id' => '微信openid', 'form_id' => 'Form ID', 'order_no' => 'Order No', 'type' => '可选值:form_id或prepay_id', 'send_count' => '使用次数', 'addtime' => 'Addtime', ]; } /** * @param array $args * [ * 'store_id'=>'店铺id', * 'user_id'=>'用户id', * 'wechat_open_id'=>'微信openid', * 'form_id'=>'Form Id 或 Prepay Id' * 'type'=>'form_id或prepay_id' * ] */ public static function addFormId($args) { if (!isset($args['form_id']) || !$args['form_id']) { return false; } if (isset($args['type']) && $args['type'] == 'form_id') { $res = CommonFormId::save([ [ 'form_id' => $args['form_id'] ] ]); return $res; } else { $model = new FormId(); $model->attributes = $args; $model->addtime = time(); return $model->save(); } } }