12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- <?php
- namespace App\Admin\Forms;
- use App\Admin\Repositories\BaseProductCategory;
- use App\Admin\Repositories\DistProduct;
- use App\Admin\Repositories\RpcAlbum;
- use App\Libraries\CommonHelper;
- use App\Models\BaseProduct;
- use App\Models\BaseProductImage;
- use Dcat\Admin\Widgets\Form;
- class ProductAudit extends Form
- {
- /**
- * Handle the form request.
- *
- * @param array $input
- *
- * @return mixed
- */
- public function handle(array $input)
- {
- $id = $this->payload['id'] ?? null;
- $reviewReply = $input['review_reply'] ?? '';
- $status = $input['status'] ?? null;
- if (empty($status) || empty($id)) {
- return $this->response()->error('参数错误');
- }
- DistProduct::auditProduct($id, $status, $reviewReply);
- return $this
- ->response()
- ->success('审批成功')
- ->refresh();
- }
- /**
- * Build a form here.
- */
- public function form()
- {
- $review_reply = $this->payload['review_reply'] ?? null;
- // 设置隐藏表单,传递用户id
- $this->radio('status')->options(['2' => admin_trans_label('audit_success'), '-1'=> admin_trans_label('approval_failed')])->default('2');
- $this->textarea('review_reply')->default($review_reply);
- }
- }
|