diff --git a/app/api/controller/StoreKeeper.php b/app/api/controller/StoreKeeper.php index d37b7a8a..a109bc63 100644 --- a/app/api/controller/StoreKeeper.php +++ b/app/api/controller/StoreKeeper.php @@ -12,26 +12,23 @@ declare (strict_types=1); namespace app\api\controller; -use app\api\service\User as UserService; use app\common\enum\RecoveryStatusEnum; +use app\common\model\UploadFile; +use app\store\model\Article as ArticleModel; use app\store\model\article\Category as CategoryModel; +use app\store\model\dealer\Order as DealerOrderModel; use app\store\model\Express as ExpressModel; +use app\store\model\Goods as GoodsModel; +use app\store\model\goods\GoodsPrice as GoodsPriceModel; +use app\store\model\Order as OrderModel; +use app\store\model\OrderRefund as OrderRefundModel; use app\store\model\store\Address as AddressModel; use app\store\model\store\shop\Clerk as ClerkModel; use app\store\service\order\Delivery as DeliveryService; use cores\exception\BaseException; use think\App; -use think\response\Json; -use app\api\service\Store as StoreService; -use think\db\exception\DataNotFoundException; use think\db\exception\DbException; -use think\db\exception\ModelNotFoundException; -use app\store\model\Goods as GoodsModel; -use app\store\model\Order as OrderModel; -use app\store\model\OrderRefund as OrderRefundModel; -use app\store\model\dealer\Order as DealerOrderModel; -use app\store\model\Article as ArticleModel; -use app\store\model\goods\GoodsPrice as GoodsPriceModel; +use think\response\Json; /** * 店主管理 @@ -197,6 +194,26 @@ class StoreKeeper extends Controller } else { $model = new OrderModel; $list = $model->getNewList($params); + if (!empty($list)) { + foreach ($list as $value) { + if (!empty($value->transfer) && !empty($value->transfer->chat_image_id)) { + if (!empty($value->transfer->chat_image_id)) { + $chat_image_ids = UploadFile::whereIn('file_id', explode(",", $value->transfer->chat_image_id))->field('file_id,file_path,file_type,storage,domain')->select(); + foreach ($chat_image_ids as &$chat_image_id) { + $chat_image_id['file_path'] = getUrl($chat_image_id['file_path'], $chat_image_id['domain']); + } + $value->transfer->chat_image_ids = $chat_image_ids; + } + if (!empty($value->transfer->transfer_image_id)) { + $transfer_image_ids = UploadFile::whereIn('file_id', explode(",", $value->transfer->transfer_image_id))->field('file_id,file_path,file_type,storage,domain')->select(); + foreach ($transfer_image_ids as &$transfer_image_id) { + $transfer_image_id['file_path'] = getUrl($transfer_image_id['file_path'], $transfer_image_id['domain']); + } + $value->transfer->transfer_image_ids = $transfer_image_ids; + } + } + } + } return $this->renderSuccess(compact('dataType', 'list')); } @@ -569,7 +586,8 @@ class StoreKeeper extends Controller * @return Json * @throws \Exception */ - public function editGoodsSeckillPrice() { + public function editGoodsSeckillPrice() + { $model = new \app\api\model\Goods(); if (!$model->editGoodsSeckillPrice($this->request->param())) { return $this->renderError($model->getError() ?: '编辑失败');