Exemple #1
0
 public function countHistory($conds = array())
 {
     extract($this->buildHistoryArg($conds));
     return Pdb::count(AccountHistory::$table, $conds);
 }
Exemple #2
0
 public function orderTimes()
 {
     return Pdb::count(UserLog::$table, array('subject=?' => $this->id, 'action=?' => 'StartBill'));
 }
Exemple #3
0
 public static function total($type)
 {
     return Pdb::count(self::$table, self::typeCond($type));
 }
Exemple #4
0
 public function countView()
 {
     return Pdb::count(UserLog::$table, array('target=?' => $this->id, 'action=?' => 'ViewProduct'));
 }
Exemple #5
0
 public function count()
 {
     $count = Pdb::count(self::$table, array('customer=?' => $this->owner_id));
     return (int) $count;
 }
Exemple #6
0
 public function loginTimes()
 {
     return Pdb::count(UserLog::$table, $this->loginConds());
 }
Exemple #7
0
 public function countCustomer($conds = array())
 {
     extract(self::buildDbArgs($conds));
     return Pdb::count($tables, $conds);
 }
Exemple #8
0
 public static function count($conds)
 {
     // tables and $conds
     extract(self::buildDbArgs($conds));
     return (int) Pdb::count($tables, $conds);
 }
Exemple #9
0
$opts = array('material' => 'PT950', 'size' => 12, 'carve_text' => 'I love U');
$opts2 = $opts;
$opts2['carve_text'] = $opts['carve_text'] . '2';
$order_dajiangyou = $customer->addProductToCart($product, $opts2);
$opts2['carve_text'] = $opts['carve_text'] . '3';
$order_to_del = $customer->addProductToCart($product, $opts2);
// add for twice
$old_num = $customer->cart()->count();
$customer->delProductFromCart($order_to_del);
$new_num = $customer->cart()->count();
test($old_num - 1, $new_num, array('name' => 'Customer del a Product from Cart'));
// case 14 Customer submit a Cart
begin_test();
$old_entry_num = Pdb::count(BigOrder::$table);
$big_order = $customer->submitCart();
$entry_num = Pdb::count(BigOrder::$table);
test($old_entry_num + 1, +$entry_num, array('name' => 'Customer submit a Cart'));
// case 15 Admin(?) edit Stone
begin_test();
$info = array('weight' => '3', 'cut' => 'EX', 'color' => '', 'polish' => '', 'clarity' => '', 'symmetry' => '', 'certificate' => '', 'no' => '', 'remark' => '');
$stone = $order->stone();
$stone->edit($info);
test(1, 1, array('name' => 'Admin(?) edit Stone'));
// case 16 Customer customize Order
begin_test();
$info = array('material' => 'PT950', 'stone' => '9', 'size' => '13', 'carve_text' => 'for test', 'remark' => 'for test');
$customer->customizeOrder($info);
test(1, 1, array('name' => 'Customer customize Order'));
// case 16 Admin recharge customer's Account then use it to pay order
begin_test();
$account = $customer->account();