255], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'mall_id' => '商城ID', 'store_id' => '门店id', 'type' => '1:推广码;2:收银台二维码', 'code' => '分享码', 'content' => '二维码参数', 'applet_code' => '小程序二维码图片地址', 'status' => '状态【1启用 0禁用 -1删除】', 'created_at' => '创建时间', 'updated_at' => '上次更新数据时间', ]; } public static function setData($params) { try { $model = new self(); $model->loadDefaultValues(); if (!$model->load($params, '')) throw new \Exception($model->getErrorMessage()); $res = $model->save(); if ($res == false) throw new \Exception($model->getErrorMessage()); return $model; } catch (\Exception $e) { self::$static_error = $e->getMessage(); return false; } } /** * 清除小程序二维码 * * @param integer $mall_id * @return boolean */ public static function cleanMiniCodeByMallId(int $mall_id) { return self::updateAll( ['applet_code' => ''], ['mall_id' => $mall_id] ); } }