|
|
|
@ -17,7 +17,7 @@ use think\response\Json; |
|
|
|
|
use cores\exception\BaseException; |
|
|
|
|
use app\store\model\Goods as GoodsModel; |
|
|
|
|
use app\store\model\goods\Import as ImportModel; |
|
|
|
|
|
|
|
|
|
use app\common\model\GoodsCategoryRel; |
|
|
|
|
/** |
|
|
|
|
* 商品管理控制器 |
|
|
|
|
* Class Goods |
|
|
|
@ -161,6 +161,15 @@ class Goods extends Controller |
|
|
|
|
$params['page'] = 1; |
|
|
|
|
$params['channels'] = ['zy']; |
|
|
|
|
$data = $model->getAdminListExport($params, $perSize)->toArray(); |
|
|
|
|
// echo "<pre>"; |
|
|
|
|
// print_r($data['data']); |
|
|
|
|
if ($data['data']) { |
|
|
|
|
foreach ($data['data'] as &$value) { |
|
|
|
|
$cates = GoodsCategoryRel::where('goods_id', $value['goods_id'])->select()->toArray(); |
|
|
|
|
$value['category_id'] = $cates ? implode(",", array_column($cates, "category_id")) : ""; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// echo "<pre>"; |
|
|
|
|
// print_r($data); |
|
|
|
|
// exit(); |
|
|
|
@ -168,15 +177,17 @@ class Goods extends Controller |
|
|
|
|
['goods_id'=>'系统编码(禁止修改)'], |
|
|
|
|
['goods_name'=>'标题'], |
|
|
|
|
['cmmdty_model'=>'商品型号'], |
|
|
|
|
['goods_source'=>'商品来源(京东 苏宁 工厂 仓储 自采 填其中一项)'], |
|
|
|
|
['goods_source'=>'商品来源(JD:京东 SN:苏宁 GC:工厂 CC:仓储 ZC:自采 填其中一项)'], |
|
|
|
|
['goods_no'=>'商品编码(电商平台同款编码)'], |
|
|
|
|
['category_id'=>'分类(填写1级到现有分类代码,中间用英文小写的逗号分开)'], |
|
|
|
|
['delivery_time'=>'发货时效(0:24小时 1:48小时 3:72小时 4:7天内 5:15天内 6:30天内 7:45天内 填写其中一项)'], |
|
|
|
|
['is_check'=>'是否审单(是填1 否填0)'], |
|
|
|
|
['delivery_id'=>'运费模板ID'], |
|
|
|
|
['status'=>'商品状态 (下架填写0 上架填写1)'], |
|
|
|
|
['status'=>'商品状态 (下架填写20 上架填写10)'], |
|
|
|
|
['cost_price_min'=>'成本价'], |
|
|
|
|
['goods_price_min'=>'前台价'], |
|
|
|
|
['stock_total'=>'库存量'], |
|
|
|
|
// ['stock_total'=>'库存量'], |
|
|
|
|
['remark'=>'下单须知'], |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
@ -188,8 +199,8 @@ class Goods extends Controller |
|
|
|
|
$model = new ImportModel; |
|
|
|
|
$params = $this->postData(); |
|
|
|
|
$params['channel'] = "zy"; |
|
|
|
|
if ($model->goodsUpdateBatch($params)) { |
|
|
|
|
return $this->renderSuccess('已添加到导入任务中,请在历史导入记录中查看结果'); |
|
|
|
|
if ($model->storeGoodsUpdateBatch($params)) { |
|
|
|
|
return $this->renderSuccess('批量修改成功'); |
|
|
|
|
} |
|
|
|
|
return $this->renderError($model->getError() ?: '操作失败'); |
|
|
|
|
|
|
|
|
|