修复错误
This commit is contained in:
parent
c08e286f74
commit
5d706254df
@ -47,7 +47,6 @@ class Demo extends BaseController
|
|||||||
$files = scandir($directory);
|
$files = scandir($directory);
|
||||||
$dir = 'def/' . date('Y-m-d');
|
$dir = 'def/' . date('Y-m-d');
|
||||||
$upload = UploadService::create();
|
$upload = UploadService::create();
|
||||||
|
|
||||||
/**循环目录 */
|
/**循环目录 */
|
||||||
foreach ($files as $file) {
|
foreach ($files as $file) {
|
||||||
if ($file === '.' || $file === '..' ||$file ==='__MACOSX') {
|
if ($file === '.' || $file === '..' ||$file ==='__MACOSX') {
|
||||||
@ -60,11 +59,13 @@ class Demo extends BaseController
|
|||||||
$slider_image = [];
|
$slider_image = [];
|
||||||
$details = [];
|
$details = [];
|
||||||
$sku_arr = [];
|
$sku_arr = [];
|
||||||
|
/**清洗图片
|
||||||
/**清洗图片 */
|
* file_two 商品名对应目录
|
||||||
|
*/
|
||||||
foreach ($files_two as $file_two) {
|
foreach ($files_two as $file_two) {
|
||||||
$arr = explode('.', $file_two);
|
$arr = $file_two;
|
||||||
if (in_array($arr[1], $image_extensions)) {
|
|
||||||
|
if (in_array($arr, $image_extensions)) {
|
||||||
/**首图 */
|
/**首图 */
|
||||||
$images[] = $file_two;
|
$images[] = $file_two;
|
||||||
if ($image == '' && is_int((int)$arr[0])) {
|
if ($image == '' && is_int((int)$arr[0])) {
|
||||||
@ -88,7 +89,7 @@ class Demo extends BaseController
|
|||||||
$sku_arr[$sku] = $directory . '/' . $file . '/' . $file_two;
|
$sku_arr[$sku] = $directory . '/' . $file . '/' . $file_two;
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
throw new \think\exception\HttpException(404, '请上传jpg,jpeg,png的图片');
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$where = ['mer_id' => $mer_id, 'is_del' => 0];
|
$where = ['mer_id' => $mer_id, 'is_del' => 0];
|
||||||
|
@ -45,7 +45,9 @@ class CloudWarehouse extends BaseController
|
|||||||
*/
|
*/
|
||||||
public function index($street_code, $page = 1, $category_id = 0,$location='')
|
public function index($street_code, $page = 1, $category_id = 0,$location='')
|
||||||
{
|
{
|
||||||
$cloud_product = Db::name('cloud_product')->where('street_code', $street_code)->where('status', 1)->page($page)->column('product_id');
|
$cloud_product = Db::name('cloud_product')
|
||||||
|
->where('cate_id',$category_id)
|
||||||
|
->where('street_code', $street_code)->where('status', 1)->page($page)->column('product_id');
|
||||||
$where = [
|
$where = [
|
||||||
'is_show' => 1,
|
'is_show' => 1,
|
||||||
'is_used' => 1,
|
'is_used' => 1,
|
||||||
@ -56,13 +58,10 @@ class CloudWarehouse extends BaseController
|
|||||||
'product_id'=>$cloud_product
|
'product_id'=>$cloud_product
|
||||||
];
|
];
|
||||||
if (!$cloud_product && $category_id==0) {
|
if (!$cloud_product && $category_id==0) {
|
||||||
|
|
||||||
return app('json')->success(['count' => 0, 'list' => []]);
|
return app('json')->success(['count' => 0, 'list' => []]);
|
||||||
}
|
}
|
||||||
$count = Db::name('cloud_product')->where('street_code', $street_code)->where('status', 1)->count();
|
$count = Db::name('cloud_product')->where('street_code', $street_code)->where('status', 1)->count();
|
||||||
if (!empty($params['category_id'])) {
|
|
||||||
$where['cate_id'] = $params['category_id'];
|
|
||||||
}
|
|
||||||
$products = $this->spuRepository->getApiSearch($where,$page,10, false,true);
|
$products = $this->spuRepository->getApiSearch($where,$page,10, false,true);
|
||||||
if($products['list']){
|
if($products['list']){
|
||||||
$list=$products['list'];
|
$list=$products['list'];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user