123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <?php
- namespace app\common\dao\store\shipping;
- use app\common\dao\BaseDao;
- use app\common\model\store\shipping\ShippingTemplateUndelivery as model;
- class ShippingTemplateUndeliveryDao extends BaseDao
- {
-
- protected function getModel(): string
- {
- return model::class;
- }
-
- public function merFieldExists($field, $value, $except = null)
- {
- return ($this->getModel())::getDB()->when($except, function ($query, $except) use ($field) {
- $query->where($field, '<>', $except);
- })->where($field, $value)->count() > 0;
- }
-
- public function batchRemove(array $id,array $temp_id)
- {
- if($id)
- ($this->getModel())::getDB()->where($this->getPk(),'in',$id)->delete();
- if($temp_id)
- ($this->getModel())::getDB()->where('temp_id','in',$temp_id)->delete();
- }
- }
|