Files
OMS/app/material/model/customer/classify.php
2025-12-28 23:13:25 +08:00

43 lines
1.0 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Copyright © ShopeX http://www.shopex.cn. All rights reserved.
* See LICENSE file for license details.
*/
/**
* 客户分类Model类
*
* @author wangbiao@shopex.cn
* @version 2024.06.12
*/
class material_mdl_customer_classify extends dbeav_model
{
/**
* 删除客户分类
*
* @param $data
* @return bool
*/
public function pre_recycle($data=null)
{
$salesMaterialObj = app::get('material')->model('sales_material');
//delete
foreach ($data as $val)
{
if(empty($val['class_id'])){
continue;
}
$saleMaterialList = $salesMaterialObj->getList('sm_id', array('class_id'=>$val['class_id']),0,1);
if($saleMaterialList){
$this->recycle_msg = '客户分类编码:'. $val['class_bn'] .'已经被销售物料使用,无法删除!';
return false;
}
}
return true;
}
}