public function run()
 {
     Illuminate\Support\Facades\DB::table('customers')->delete();
     for ($i = 0; $i < 50; $i++) {
         Customer::create(['name' => '测试客户' . ($i + 1), 'phoneNum' => (string) (15253212675.0 + $i), 'wx' => 'jm_god_father_' . $i, 'address' => '青岛市香港中路132号3号楼1505', 'customer_category_id' => $i % 2 == 0 ? 1 : 2]);
     }
 }
 public function run()
 {
     Illuminate\Support\Facades\DB::table('suppliers')->delete();
     for ($i = 0; $i < 45; ++$i) {
         Suppliers::create(['name' => '测试供应商1' . $i, 'address' => '首尔' . $i . '路' . $i . '号', 'wx_num' => 'aasdd_dd', 'phone_num' => '18653292593', 'qq' => '22345642']);
     }
 }
 public function run()
 {
     Illuminate\Support\Facades\DB::table('products')->delete();
     // 插入100条测试数据
     for ($i = 0; $i < 100; ++$i) {
         Product::create(['model_id' => 'EFG4' . (string) ($i * 100), 'name' => '测试产品' . (string) $i, 'origin_price' => 332.34 * $i, 'demestic_price' => 123 * $i, 'count' => $i, 'thumbnail' => 'test.jpg', 'detail_image' => '', 'category_id' => $i % 2 == 0 ? 1 : 2, 'brand_id' => $i % 2 == 0 ? 2 : 1]);
     }
 }
Example #4
0
 function select($query, $parameters = array())
 {
     return Illuminate\Support\Facades\DB::select($query, $parameters);
 }
Example #5
0
|Guest Routes
|--------------------------------------------------------------------
| Here defining Guest User's routes
|
|
*/
// seasrch
Route::POST('tickets/search/', function () {
    $keyword = Illuminate\Support\Str::lower(Input::get('auto'));
    $models = App\Model\Ticket\Tickets::where('ticket_number', '=', $keyword)->orderby('ticket_number')->take(10)->skip(0)->get();
    $count = count($models);
    return Illuminate\Support\Facades\Redirect::back()->with("contents", $models)->with("counts", $count);
});
Route::any('getdata', function () {
    $term = Illuminate\Support\Str::lower(Input::get('term'));
    $data = Illuminate\Support\Facades\DB::table("tickets")->distinct()->select('ticket_number')->where('ticket_number', 'LIKE', $term . '%')->groupBy('ticket_number')->take(10)->get();
    foreach ($data as $v) {
        return ['value' => $v->ticket_number];
    }
});
Route::get('getform', ['as' => 'guest.getform', 'uses' => 'Client\\helpdesk\\FormController@getForm']);
/* get the form for create a ticket by guest user */
Route::post('postform/{id}', 'Client\\helpdesk\\FormController@postForm');
/* post the AJAX form for create a ticket by guest user */
Route::post('postedform', 'Client\\helpdesk\\FormController@postedForm');
/* post the form to store the value */
Route::get('check', 'CheckController@getcheck');
//testing checkbox auto-populate
Route::post('postcheck/{id}', 'CheckController@postcheck');
Route::get('home', ['as' => 'home', 'uses' => 'Client\\helpdesk\\WelcomepageController@index']);
//guest layout
Example #6
0
 /**
  * This will get the data rows from the database
  * with the all where queries
  *
  * @return void
  */
 private function setResultRows()
 {
     $this->query->select($this->columnsToSelect);
     $this->resultRows = $this->query->get();
 }