where($dis)->find(); if(empty($data)){ $this->insert($dis); } return $this->where($dis)->field($field)->find()->toArray(); } /** * @author chenniang * @DataTime: 2020-06-08 18:49 * @功能说明:添加 */ public function settingAdd($data){ $res = $this->insert($data); return $res; } /** * @author chenniang * @DataTime: 2020-03-18 12:24 * @功能说明:配置编辑 */ public function settingUpdate($dis,$data){ $data['app_id'] = !empty($data['app_id'])?implode(',',$data['app_id']):''; $res = $this->where($dis)->update($data); return $res; } }