$params['mer_name'], 'phone' => $params['phone'], 'settle_cycle' => $params['settle_cycle'], 'address' => $params['address'], 'mark' => $params['mark'], 'status' => $params['status'] ]); Db::commit(); return true; } catch (\Exception $e) { Db::rollback(); throw new BusinessException($e->getMessage()); } } /** * @notes 编辑供应链 * @param array $params * @return bool * @author admin * @date 2024/08/15 14:10 */ public static function edit(array $params): bool { Db::startTrans(); try { Supplier::where('id', $params['id'])->update([ 'mer_name' => $params['mer_name'], 'phone' => $params['phone'], 'settle_cycle' => $params['settle_cycle'], 'address' => $params['address'], 'mark' => $params['mark'], 'status' => $params['status'] ]); Db::commit(); return true; } catch (\Exception $e) { Db::rollback(); throw new BusinessException($e->getMessage()); } } /** * @notes 删除供应链 * @param array $params * @return bool * @author admin * @date 2024/08/15 14:10 */ public static function delete(array $params): bool { return Supplier::destroy($params['id']); } /** * @notes 获取供应链详情 * @param $params * @return array * @author admin * @date 2024/08/15 14:10 */ public static function detail($params): array { return Supplier::findOrEmpty($params['id'])->toArray(); } }