1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?php
- namespace app\common\model;
- use think\facade\Db;
- /**
-
- *
-
- *
- * ----------------------------------------------------------------------------
- *
-
- * 数据层模型
- */
- class Storenavigation extends BaseModel
- {
- protected static function init()
- {
- parent::init(); // TODO: Change the autogenerated stub
- }
- /**
- * 读取列表
- * @access public
- * @author csdeshang
- * @param type $condition 条件
- * @param type $field 字段
- * @return type
- */
- public function getStorenavigationList($condition, $field = '*')
- {
- $result = Db::name('storenavigation')->field($field)->where($condition)->order('storenav_sort asc')->select()->toArray();
- return $result;
- }
- /**
- * 读取单条记录
- * @access public
- * @author csdeshang
- * @param array $condition
- * @return array
- */
- public function getStorenavigationInfo($condition)
- {
- $result = Db::name('storenavigation')->where($condition)->find();
- return $result;
- }
- /**
- * 增加
- * @access public
- * @author csdeshang
- * @param array $data 参数内容
- * @return bool
- */
- public function addStorenavigation($data)
- {
- return Db::name('storenavigation')->insertGetId($data);
- }
- /**
- * 更新
- * @access public
- * @author csdeshang
- * @param array $update 更新数据
- * @param array $condition 条件
- * @return bool
- */
- public function editStorenavigation($update, $condition)
- {
- return Db::name('storenavigation')->where($condition)->update($update);
- }
- /**
- * 删除
- * @access public
- * @author csdeshang
- * @param array $condition 条件
- * @return bool
- */
- public function delStorenavigation($condition)
- {
- return Db::name('storenavigation')->where($condition)->delete();
- }
- }
|