|
|
@ -21,18 +21,15 @@ class BatchAuditProduct extends BatchAction |
|
|
*/ |
|
|
*/ |
|
|
protected $action; |
|
|
protected $action; |
|
|
private ?string $title_text; |
|
|
private ?string $title_text; |
|
|
private $type = null; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* BatchAuditProduct constructor. |
|
|
* BatchAuditProduct constructor. |
|
|
* @param null $title |
|
|
* @param null $title |
|
|
* @param int $action 1:通过;2:拒绝 |
|
|
* @param int $action 1:通过;2:拒绝 |
|
|
* @param int $type 1:普通产品Product;2:行业产品IndustryProduct; |
|
|
|
|
|
*/ |
|
|
*/ |
|
|
public function __construct($title = null, $action = 1, $type = 1) |
|
|
|
|
|
|
|
|
public function __construct($title = null, $action = 1) |
|
|
{ |
|
|
{ |
|
|
$this->action = $action; |
|
|
$this->action = $action; |
|
|
$this->type = $type; |
|
|
|
|
|
|
|
|
|
|
|
$this->title_text = $action == 1 ? '审核通过' : '审核拒绝'; |
|
|
$this->title_text = $action == 1 ? '审核通过' : '审核拒绝'; |
|
|
$this->title = '<i class="fa '.($action == 1 ? 'fa-check-square' : 'fa-times-circle') . '"></i> ' . $this->title_text; |
|
|
$this->title = '<i class="fa '.($action == 1 ? 'fa-check-square' : 'fa-times-circle') . '"></i> ' . $this->title_text; |
|
|
@ -50,12 +47,7 @@ class BatchAuditProduct extends BatchAction |
|
|
public function handle(Request $request) |
|
|
public function handle(Request $request) |
|
|
{ |
|
|
{ |
|
|
$status = $request->action == 1 ? ProductStatus::ON_SALE : ProductStatus::REFUSE; |
|
|
$status = $request->action == 1 ? ProductStatus::ON_SALE : ProductStatus::REFUSE; |
|
|
|
|
|
|
|
|
if ($request->type == 1) { |
|
|
|
|
|
Product::whereIn('id', $this->getKey())->update(['status' => $status]); |
|
|
|
|
|
} else { |
|
|
|
|
|
IndustryProduct::whereIn('id', $this->getKey())->update(['status' => $status]); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
Product::whereIn('id', $this->getKey())->update(['status' => $status]); |
|
|
|
|
|
|
|
|
return $this->response()->success('操作成功!')->refresh(); |
|
|
return $this->response()->success('操作成功!')->refresh(); |
|
|
} |
|
|
} |
|
|
@ -75,7 +67,6 @@ class BatchAuditProduct extends BatchAction |
|
|
{ |
|
|
{ |
|
|
return [ |
|
|
return [ |
|
|
'action' => $this->action, |
|
|
'action' => $this->action, |
|
|
'type' => $this->type, |
|
|
|
|
|
]; |
|
|
]; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |