field($field)->where(['id'=>1])->find(); if(is_array($result)) { $data['and_file_url'] = $url . substr($result['file_url'],1); $data['and_file_size'] = $result['file_size']; $data['and_remark'] = $result['remark']?json_decode($result['remark']):[]; } };break; case 2:{ $data['ios_version_code'] = C('IOS_VERSION'); $result = $app->field($field)->where(['id'=>4])->find(); if(is_array($result)) { $data['ios_file_url'] = $url . substr($result['file_url'],1); $data['ios_file_size'] = $result['file_size']; $data['ios_remark'] = $result['remark']?json_decode($result['remark']):[]; } };break; default: $data['and_version_code'] = C('APP_VERSION'); $data['ios_version_code'] = C('IOS_VERSION'); $result = $app->field($field)->where(['id'=>['in',[1,4]]])->select(); foreach($result as $k => $v) { if($v['version']==1) { $data['and_file_url'] = $url . substr($v['file_url'],1); $data['and_file_size'] = $v['file_size']; $data['and_remark'] = $v['remark']?json_decode($v['remark']):[]; } elseif($v['version']==2) { $data['ios_file_url'] = $url . substr($v['file_url'],1); $data['ios_file_size'] = $v['file_size']; $data['ios_remark'] = $v['remark']?json_decode($v['remark']):[]; } } } $this->new_set_message(200, "success", $data); } }