| | |
| | | /** |
| | | * 分组详情 |
| | | */ |
| | | public static function detail($group_id, $shop_supplier_id = 0) { |
| | | return (new static())->where('shop_supplier_id', '=', $shop_supplier_id)->find($group_id); |
| | | public static function detail($group_id, $shop_supplier_id = 0, $branch_id = 0) { |
| | | return (new static())->where('shop_supplier_id', '=', $shop_supplier_id) |
| | | ->where('branch_id', '=', $branch_id) // by lyzflash |
| | | ->find($group_id); |
| | | } |
| | | |
| | | /** |
| | | * 获取列表记录 |
| | | */ |
| | | public function getList($groupType = '', $shop_supplier_id = 0) |
| | | public function getList($groupType = '', $shop_supplier_id = 0, $branch_id = 0) |
| | | { |
| | | $model = $this; |
| | | !empty($groupType) && $model = $model->where('group_type', '=', trim($groupType)); |
| | | return $model->where('shop_supplier_id', '=', $shop_supplier_id) |
| | | ->where('branch_id', '=', $branch_id) |
| | | ->where('is_delete', '=', 0) |
| | | ->order(['sort' => 'asc', 'create_time' => 'desc']) |
| | | ->select(); |