/**
  * @covers ::save
  * @covers ::get
  */
 public function testUpdate()
 {
     $position = (object) array('positionId' => 1, 'positionName' => 'MY POSITION', 'positionDescription' => 'THIS IS A COOL JOB', 'employeeArea' => 2, 'deleted' => 0, 'guid' => null);
     $accessor = new Position();
     $accessor->save($position);
     $getter = $accessor->get(1);
     $this->assertEquals(1, $getter->positionId);
     $this->assertEquals(2, $getter->employeeArea);
     $position2 = (object) array('positionId' => 1, 'positionName' => 'MY POSITION', 'positionDescription' => 'THIS IS A COOL JOB', 'employeeArea' => 1, 'deleted' => 0);
     $accessor->save($position2);
     $getter = $accessor->get(1);
     $this->assertEquals(1, $getter->positionId);
     $this->assertEquals(1, $getter->employeeArea);
 }
Esempio n. 2
0
 public static function getNode()
 {
     $s = Position::get();
     self::$node = $s;
     return new self();
 }
Esempio n. 3
0
 public static function getPosition($key = null, $val = null)
 {
     if (is_null($key)) {
         $c = Position::get();
         self::$position = $c;
         return new self();
     } else {
         $c = Position::where($key, '=', $val)->first();
         self::$position = $c;
         return $c;
     }
 }
Esempio n. 4
0
    Route::resource('awb', 'Api\\AwbController');
    Route::resource('status', 'Api\\StatusController');
    Route::get('fl/order', 'Api\\FlapiController@index');
    Route::post('fl/status', 'Api\\FlapiController@postStatus');
    Route::post('sap/status', 'Api\\SapapiController@postStatus');
    Route::resource('sap/awb', 'Api\\SapapiController');
    Route::get('g21/order', 'Api\\G21apiController@index');
});
Route::get('lastup/{log}', function ($log) {
    $last = Threeplstatuslog::where('consignee_logistic_id', '=', $log)->orderBy('timestamp', 'desc')->first();
    print date('Y-m-d H:i:s', $last->timestamp->sec);
    print_r($last->toArray());
});
Route::get('tolower', function () {
    $pos = new Position();
    $nodes = $pos->get();
    $blist = array('_id', 'createdDate', 'lastUpdate');
    foreach ($nodes as $n) {
        $nv = $n->toArray();
        print_r($nv);
        foreach ($nv as $key => $value) {
            if (in_array($key, $blist)) {
            } else {
                $n->{strtolower($key)} = $value;
            }
        }
        $n->save();
    }
});
Route::get('btest', function () {
    $model = new Merchant();