|
|
|
@ -39,19 +39,19 @@ class GoodsAddPrice extends BaseService |
|
|
|
|
* @throws \think\db\exception\DbException |
|
|
|
|
* @throws \think\db\exception\ModelNotFoundException |
|
|
|
|
*/ |
|
|
|
|
public function batch(array $categoryIds, int $rate, array $channels): bool |
|
|
|
|
public function batch(array $goods, int $rate): bool |
|
|
|
|
{ |
|
|
|
|
// ini_set('memory_limit', '1024M'); |
|
|
|
|
// set_time_limit(0); |
|
|
|
|
$goods = GoodsModel::alias('g') |
|
|
|
|
->join('goods_category_rel c', 'g.goods_id = c.goods_id') |
|
|
|
|
->where('c.store_id',0) |
|
|
|
|
->where('g.is_delete',0) |
|
|
|
|
->whereIn('c.category_id', $categoryIds) |
|
|
|
|
->whereIn('g.channel',$channels) |
|
|
|
|
->order("g.goods_id asc") |
|
|
|
|
->select() |
|
|
|
|
->toArray(); |
|
|
|
|
// $goods = GoodsModel::alias('g') |
|
|
|
|
// ->join('goods_category_rel c', 'g.goods_id = c.goods_id') |
|
|
|
|
// ->where('c.store_id',0) |
|
|
|
|
// ->where('g.is_delete',0) |
|
|
|
|
// ->whereIn('c.category_id', $categoryIds) |
|
|
|
|
// ->whereIn('g.channel',$channels) |
|
|
|
|
// ->order("g.goods_id asc") |
|
|
|
|
// ->select() |
|
|
|
|
// ->toArray(); |
|
|
|
|
if (!$goods) { |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|