{"id":1727,"date":"2017-12-28T17:11:17","date_gmt":"2017-12-28T09:11:17","guid":{"rendered":"http:\/\/www.youthtribe.com\/?p=1727"},"modified":"2017-12-28T17:11:17","modified_gmt":"2017-12-28T09:11:17","slug":"laravel%e7%9a%84%e6%97%b6%e9%97%b4%e6%ae%b5orm%e6%9f%a5%e8%af%a2","status":"publish","type":"post","link":"http:\/\/www.youthtribe.com\/archives\/1727","title":{"rendered":"laravel\u7684\u65f6\u95f4\u6bb5orm\u67e5\u8be2"},"content":{"rendered":"
public function payRollList($time)\r\n    {\r\n        $member_phone = Session::get(phone');\r\n        $engineer = Engineer::getEngineerByPhone($member_phone);\r\n        $start=date('Y-m-01',strtotime($time));\/\/\u83b7\u53d6\u6307\u5b9a\u6708\u4efd\u7684\u7b2c\u4e00\u5929\r\n        $end=date('Y-m-t',strtotime($time)); \/\/\u83b7\u53d6\u6307\u5b9a\u6708\u4efd\u7684\u6700\u540e\u4e00\u5929\r\n        $repair=DB::table('order')\r\n            ->where('repair_user',$engineer['member_id'])\r\n            ->where('order_status',1)\r\n            ->whereBetween('create_time',[strtotime($start),strtotime($end)])\r\n            ->where('status',0)\r\n            ->orderBy('create_time', 'desc')\r\n            ->paginate($this->number);\r\n        return view('home.engineer.payroll_order')->with('phone', $member_phone)->with('repair', $repair);\r\n    }\r\n\r\n\r\n<\/pre>\n

\u4e3b\u8981\u662fwhereBetween\u8fd9\u53e5\u3002create_time \u4e3amysql\u7684timestamp\u7c7b\u578b<\/p>\n

whereBetween('create_time',[strtotime($start),strtotime($end)])<\/pre>\n

\u539f\u6587\u5730\u5740\uff1ahttps:\/\/www.cnblogs.com\/lamp01\/p\/6914089.html<\/p>\n

 <\/p>\n","protected":false},"excerpt":{"rendered":"

public function payRollList($time) { $member_phone = Session::get(phone’); $engineer = Engineer::getEngineerByPhone($member_phone); $start=date(‘Y-m-01’,strtotime($time));\/\/\u83b7\u53d6\u6307\u5b9a\u6708\u4efd\u7684\u7b2c\u4e00\u5929 $end=date(‘Y-m-t’,strtotime($time)); \/\/\u83b7\u53d6\u6307\u5b9a\u6708\u4efd\u7684\u6700\u540e\u4e00\u5929 $repair=DB::table(‘order’) ->where(‘repair_user’,$engineer[‘me<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[260,288],"_links":{"self":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/1727"}],"collection":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/comments?post=1727"}],"version-history":[{"count":1,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/1727\/revisions"}],"predecessor-version":[{"id":1728,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/posts\/1727\/revisions\/1728"}],"wp:attachment":[{"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/media?parent=1727"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/categories?post=1727"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.youthtribe.com\/wp-json\/wp\/v2\/tags?post=1727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}