ajaxReturn($result); } } /* * 图片上传 */ public function reason_img() { $merchant_id = self::$merchant_id; $store_id = self::$store_id; $item_arr = array( 'add_time' => time(), 'from_type_id' => 48, 'localUrl' => 'Store/Reason', 'user_type' => 6, 'merchant_id' => $merchant_id, 'store_id' => $store_id ); $uploads = uploadFiles($item_arr);//上传图片 foreach(array_keys($uploads) as $key) { if (!empty($uploads[$key])) { $res['status'] = 1; $res[$key . '_id'] = $uploads[$key]['id']; //商品展示图片 $res['path'] = $uploads[$key]['path']; //商品展示图片 } else { $res['status'] = 0; $res['path'] = '图片上传失败'; $res['status'] = 0; } } $this->ajaxReturn($res); } public function upload() { $this->reason_img(); } }