100], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'mall_id' => 'Mall ID', 'province_id' => '省级ID', 'city_id' => '市级ID', 'district_id' => '区级ID', 'street_id' => '街道ID', 'community_name' => '社区名称', 'status' => '是否删除', 'created_at' => '创建时间', 'updated_at' => '修改时间', ]; } /** * @desc:保存数据 * @Author: hua * @Date: 2024/08/21 * @Time: 18:07 * @Copyright: copyright (c) 2021 广东七件事集团 * @param array $params * @return StoreClerk|false|null */ public static function setData(array $params) { try { if (!empty($params['mall_id']) && !empty($params['user_id'])) { $model = self::findOne(['mall_id' => $params['mall_id'],'province_id' => $params['province_id'], 'city_id'=>$params['city_id'],'district_id' => $params['district_id'], 'street_id' => $params['street_id'],'community_name'=>$params['community_name'],'status' => 0]); if (empty($model)) { $model = new self(); $model->loadDefaultValues(); } } else { $model = new self(); $model->loadDefaultValues(); } if (!$model->load($params, '')) throw new \Exception($model->getErrorMessage()); if (!$model->save()) throw new \Exception($model->getErrorMessage()); return $model; } catch (\Exception $e) { self::$static_error = $e->getMessage(); return false; } } }