123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- <?php
- namespace app\common\model;
- use think\facade\Db;
- class Storegrade extends BaseModel {
-
-
- public function getStoregradeList($condition = array(),$order = 'storegrade_sort asc') {
- $result = Db::name('storegrade')->where($condition)->order($order)->select()->toArray();
- return $result;
- }
-
- public function getOneStoregrade($id) {
- if (intval($id) > 0) {
- $result = Db::name('storegrade')->where('storegrade_id',$id)->find();
- return $result;
- } else {
- return false;
- }
- }
-
- public function addStoregrade($data) {
- if (empty($data)) {
- return false;
- }
- $result = Db::name('storegrade')->insertGetId($data);
- return $result;
- }
-
- public function editStoregrade($storegrade_id,$data) {
- if (empty($data)) {
- return false;
- }
- $result = Db::name('storegrade')->where('storegrade_id',$storegrade_id)->update($data);
- return $result;
- }
-
- public function delStoregrade($storegrade_id) {
- $storegrade_id = intval($storegrade_id);
- if ($storegrade_id > 0) {
- $result = Db::name('storegrade')->where('storegrade_id', $storegrade_id)->delete();
- return $result;
- } else {
- return false;
- }
- }
- }
- ?>
|