|
|
|
@ -12,8 +12,8 @@ declare (strict_types=1); |
|
|
|
|
|
|
|
|
|
namespace app\admin\controller; |
|
|
|
|
|
|
|
|
|
use think\response\Json; |
|
|
|
|
use think\facade\Db; |
|
|
|
|
use think\response\Json; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 商城管理 |
|
|
|
@ -61,24 +61,17 @@ class Goods extends Controller |
|
|
|
|
if (isset($params['max_price']) && $params['max_price']) { |
|
|
|
|
$where[] = ['net_price', '<=', $params['max_price']]; |
|
|
|
|
} |
|
|
|
|
$list = Db::connect("dataCenterMysql")->table('goods_sku') |
|
|
|
|
->where($where) |
|
|
|
|
->order($sort." ".$order) |
|
|
|
|
->paginate($this->request->param('per_page', 15))->each(function ($item, $key){ |
|
|
|
|
$item['create_time'] = date("Y-m-d H:i:s", $item['create_time']); |
|
|
|
|
$item['update_time'] = date("Y-m-d H:i:s", $item['update_time']); |
|
|
|
|
$item['channel'] = config('app.platformList')[$item['channel']] ?? ""; |
|
|
|
|
return $item; |
|
|
|
|
}); |
|
|
|
|
$list = Db::connect("dataCenterMysql")->table('goods_sku') |
|
|
|
|
->where($where) |
|
|
|
|
->order($sort, $order) |
|
|
|
|
->paginate($this->request->param('per_page', 15))->each(function ($item, $key) { |
|
|
|
|
$item['create_time'] = date("Y-m-d H:i:s", $item['create_time']); |
|
|
|
|
$item['update_time'] = date("Y-m-d H:i:s", $item['update_time']); |
|
|
|
|
$item['channel'] = config('app.platformList')[$item['channel']] ?? ""; |
|
|
|
|
return $item; |
|
|
|
|
}); |
|
|
|
|
return $this->renderSuccess(compact('list')); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|