如何将ThinkPHP5中的Service层改写为长尾关键词?

2026-04-03 14:001阅读0评论SEO基础
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计126个文字,预计阅读时间需要1分钟。

如何将ThinkPHP5中的Service层改写为长尾关键词?

phpclass WarehouseOrderPersonService{ public function __construct() { $this->db=new WarehouseOrderPerson(); }

public function create($data) { return $this->db->add($data) ? ret_ok('创建成功') : ret_no('创建失败'); }}

如何将ThinkPHP5中的Service层改写为长尾关键词?

tp5:service:create

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('修改失败'); }

本文共计126个文字,预计阅读时间需要1分钟。

如何将ThinkPHP5中的Service层改写为长尾关键词?

phpclass WarehouseOrderPersonService{ public function __construct() { $this->db=new WarehouseOrderPerson(); }

public function create($data) { return $this->db->add($data) ? ret_ok('创建成功') : ret_no('创建失败'); }}

如何将ThinkPHP5中的Service层改写为长尾关键词?

tp5:service:create

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('修改失败'); }