12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <?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;
- }
- }
- }
|