feature/main20240421
郭嘉 6 months ago
parent a226de402b
commit a2a6fefa51
  1. 10
      app/common/model/PaymentTemplate.php
  2. 2
      app/store/controller/setting/payment/Template.php

@ -110,9 +110,15 @@ class PaymentTemplate extends BaseModel
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getAll()
public function getAll($merchantId = 0)
{
return $this->where('is_delete', '=', 0)
$where = [
['is_delete', '=', 0],
];
if (isset($merchantId) && $merchantId) {
$where[] = ['merchant_id', '=', $merchantId];
}
return $this->where($where)
->order(['sort' => 'asc', $this->getPk()])
->select();
}

@ -45,7 +45,7 @@ class Template extends Controller
public function all(): Json
{
$model = new PaymentTemplateModel;
$list = $model->getAll();
$list = $model->getAll($this->merchantId);
return $this->renderSuccess(compact('list'));
}

Loading…
Cancel
Save