- public $db;
- public function __construct()
- {
- parent::__construct();
- $this->db = new WarehouseOrderPerson();
- }
- public function create($data)
- {
- return $this->db->add($data) > 0 ? ret_ok('创建成功') : ret_no('创建失败');
- }
- public function delete()
- {
- $this->request->post(['is_delete' => 1]);
- return $this->db->modifyOne_byId(input('post.')) > 0 ? ret_ok('删除成功') : ret_no('删除失败');
- }
- public function modify()
- {
- return $this->db->modifyOne_byId(input('post')) > 0 ? ret_ok('修改成功') : ret_no('修改失败');
- }
- //该片段来自于http://www.codesnippet.cn/detail/0606201715224.html
来源: http://www.codesnippet.cn/detail/0606201715224.html