getMessage(), 500); } } /** * Notes:修改产品分类 * @param array $param * @return int * User: QJF * Date: 2022/9/21 */ public static function updatePackageGoodsCategory($param) { SystemRole::affairBegin(); try { $where = []; $where['category_id'] = $param['category_id']; $param['category_update_time'] = time(); $result = PackageGoodsCategory::where($where)->update($param); if ($result !== false){ SystemRole::affairCommit(); return true; } throw new \Exception('操作失败!'); }catch (\Exception $exception){ SystemRole::affairRollback(); throw new \Exception($exception->getMessage(), 500); } } /** * Notes:任务 * @param int $role_id * @return int * User: QJF * Date: 2022/9/19 */ public static function delPackageGoodsCategory($category_id) { SystemRole::affairBegin(); try { $where = []; $where['category_id'] = $category_id; $data['category_delete_time'] = time(); $result = PackageGoodsCategory::where($where)->update($data); if (!empty($result)){ SystemRole::affairCommit(); return true; }else{ return false; } }catch (\Exception $exception){ SystemRole::affairRollback(); throw new \Exception($exception->getMessage(), 500); } } /** * Notes:获取权益包详情 * @param int $category_id * @return int * User: QJF * Date: 2022/9/19 */ public static function infoPackageCategory($category_id) { SystemRole::affairBegin(); try { $where = []; $where['category_id'] = $category_id; $result = PackageGoodsCategory::where($where)->first(); if (!empty($result)){ SystemRole::affairCommit(); return $result; }else{ return false; } }catch (\Exception $exception){ SystemRole::affairRollback(); throw new \Exception($exception->getMessage(), 500); } } }